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
Node.js dns.getServers() returns 127.0.0.1 on Windows 11 while Windows DNS is configured correctly, causing dns.resolveSrv() and MongoDB Atlas (mongodb+srv://) to fail #64428
dns.resolve4() and dns.resolveSrv() fail with ECONNREFUSED.
Calling dns.setServers(["8.8.8.8", "1.1.1.1"]) before performing DNS resolution makes the issue disappear.
What is the expected behavior? Why is that the expected behavior?
dns.getServers() should return the DNS servers configured by the operating system rather than 127.0.0.1, since Windows is configured to use DHCP-assigned DNS servers.
On my system:
ipconfig /all reports:
IPv4 DNS: 10.219.174.109
IPv6 DNS: 2409:40c2:8427:7b61::c7
nslookup works correctly.
Resolve-DnsName works correctly.
dns.lookup() works correctly.
Therefore I expect:
dns.getServers() to report the DNS servers configured by Windows.
dns.resolve4() and dns.resolveSrv() to successfully resolve DNS records without requiring an explicit call to dns.setServers().
Instead, dns.getServers() reports ['127.0.0.1'], causing dns.resolve4() and dns.resolveSrv() to fail with ECONNREFUSED.
What do you see instead?
Instead of using the DNS servers configured by Windows, dns.getServers() returns:
[ '127.0.0.1' ]
As a result:
dns.lookup() succeeds because it uses the operating system's resolver.
Activity
Renegade334 commentedon Jul 11, 2026
Duplicate of #62347. The fix should land in the next releases.