Repository navigation
CASSNODEJS-16: Use system resolver for contact points - #479
Merged
SiyaoIsHiding merged 1 commit intoOct 15, 2026
Merged
Conversation
jorgebay
requested review from
SiyaoIsHiding
and
a balanced review from Copilot
October 8, 2026 15:48
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
2 open findings
What changed in this PR
Updates the control connection hostname resolution to use the OS/system resolver via dns.lookup(..., { all: true }), ensuring contact points honor platform name-resolution policies and return all IPv4/IPv6 addresses.
Changes:
- Replaced
dns.resolve4()/dns.resolve6()logic with a singledns.lookup(name, { all: true })call in_resolveAll(). - Updated unit tests to stub/assert
dns.lookup()behavior (including multi-address results and error/empty cases).
| File | Description |
|---|---|
| lib/control-connection.js | Switches _resolveAll() to use OS resolver (dns.lookup with { all: true }) and simplifies error handling. |
| test/unit/control-connection-tests.js | Adjusts mocks/assertions to validate dns.lookup usage and new error/empty-result behaviors. |
🧠 Review effort: Lite
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
Copilot stopped reviewing on behalf of
jorgebay due to an error
October 8, 2026 16:45
finalchild
commented
Oct 8, 2026
SiyaoIsHiding
approved these changes
Oct 14, 2026
SiyaoIsHiding
left a comment
Contributor
There was a problem hiding this comment.
Looks good to me, thank you very much for the contribution!
patch by finalchild; reviewed by Jorge Bay and Jane He
SiyaoIsHiding
force-pushed
the
fix/system-resolver-contact-points
branch
from
October 14, 2026 19:51
e58f8ab to
3b003da
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
dns.lookup(name, { all: true }).Motivation
The current implementation uses
dns.resolve4()anddns.resolve6(), which query DNS through c-ares rather than following the operating system's complete name-resolution policy. This can bypass hosts files, NSS, Windows name-resolution policy, VPN and split-DNS configuration, and resolvers such as Tailscale MagicDNS.The direct-DNS implementation was introduced in #147 when this driver supported Node.js 0.10. The driver now requires Node.js 20 or newer, where
dns.lookup()supports{ all: true }, so using the system resolver no longer requires sacrificing multi-address discovery.This also follows the approach used by other official Cassandra drivers:
InetAddress.getAllByName()inAddressUtils.extract().socket.getaddrinfo(..., AF_UNSPEC, SOCK_STREAM).uv_getaddrinfo()withAF_UNSPECand iterates every result.This interacted badly with search domain with Tailscale.
localhostresolved tolocalhost.search.domaininstead. Using the OS resolver avoids this issue and is more idiomatic.On Windows, when using resolve4/6,
localhostdoes not return the loopback adddress. On typical Linux, resolve4/6 queries systemd-resolved which returns loopback address.References