-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dns.lookup('localhost', { all: true}) returns only ::1 with Node.js v22.12, while v22.11 returned both ::1 and 127.0.0.1 #56137
Labels
confirmed-bug
Issues with confirmed bugs.
dns
Issues and PRs related to the dns subsystem.
windows
Issues and PRs related to the Windows platform.
Comments
jakecastelli
added
dns
Issues and PRs related to the dns subsystem.
windows
Issues and PRs related to the Windows platform.
labels
Dec 5, 2024
4 tasks
Bisecting points to ecedcba as the first bad commit. |
lpinca
added a commit
to lpinca/node
that referenced
this issue
Dec 11, 2024
Fixes: nodejs#56137 Refs: nodejs#56223
This was referenced Dec 12, 2024
aduh95
pushed a commit
that referenced
this issue
Dec 18, 2024
Fixes: #56137 Refs: #56223 PR-URL: #56224 Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: Richard Lau <[email protected]>
aduh95
pushed a commit
that referenced
this issue
Dec 18, 2024
Fixes: #56137 Refs: #56223 PR-URL: #56224 Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: Richard Lau <[email protected]>
ruyadorno
pushed a commit
that referenced
this issue
Dec 20, 2024
Fixes: #56137 Refs: #56223 PR-URL: #56224 Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: Richard Lau <[email protected]>
ruyadorno
pushed a commit
that referenced
this issue
Dec 21, 2024
Fixes: #56137 Refs: #56223 PR-URL: #56224 Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: Richard Lau <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
confirmed-bug
Issues with confirmed bugs.
dns
Issues and PRs related to the dns subsystem.
windows
Issues and PRs related to the Windows platform.
Version
v22.12.0
Platform
Subsystem
dns
What steps will reproduce the bug?
On my Windows 11 system, the
localhost
hostname resolves to both::1
and127.0.0.1
, as confirmed by PowerShellResolve-DnsName
:And with Node.js v22.11 (and v20, and v18), both addresses are returned by a DNS lookup, as expected:
However with Node.js v22.12, only
::1
is returned:How often does it reproduce? Is there a required condition?
It repros consistently on Windows.
I do not see the same problem on Linux: after editing
/etc/hosts
to include dual mappings forlocalhost
, I do see both addresses returned from the Node.js DNS lookup, and it is consistent between Node.js v22.11 and v22.12.What is the expected behavior? Why is that the expected behavior?
I found this bug because we have some Node.js test code that needs to connect to a port on localhost without knowing whether the local server is listening on the IPv4 or IPv6 localhost. It actually uses
net.createConection({..., autoSelectFamily: true })
, but the problem seems to be with the DNS resolution before the "happy eyeballs" algorithm gets a chance to auto-select an address family. Because only ::1 is tried, the connection fails if the local server was actually listening on IPv4.What do you see instead?
...when the server was actually listening on
127.0.0.1:51793
Additional information
No response
The text was updated successfully, but these errors were encountered: