You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
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
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 for localhost, 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?
Error: connect ECONNREFUSED ::1:51793
...when the server was actually listening on 127.0.0.1:51793
Activity
lpinca commentedon Dec 11, 2024
Bisecting points to ecedcba as the first bad commit.
deps: update libuv to 1.49.2
deps: update libuv to 1.49.2
deps: update libuv to 1.49.2
deps: update libuv to 1.49.2
dns.lookupdoes not return the IPv4 address for "localhost" #56311 as a duplicate of this issuedeps: update libuv to 1.49.2
[test] pin loopback test bind/dial sites to 127.0.0.1
fix(tooling): reach loopback-only Docker ports via 127.0.0.1; explain…