Repository navigation
dns.resolveSrv returns ECONNREFUSED on Windows since v24.13.0 (still broken in v25.x and v26.x) #62326
Description
Activity
Yes, I'm having the same issue as before with the latest versions of 24 and 25 on Windows.
Reacted by Ryan KastI have the same problem, can confirm the last working version on Node.js 24 is v24.12.0
Reacted by alexhcj, Matt Thomas, Drew Johnson, Ryan Kast and rtrittoReacted by Drew Johnson and Ryan Kast- changed the title
[-]dns.resolveSrv returns ECONNREFUSED on Windows since v24.13.0 (still broken in v25.x)[/-][+]dns.resolveSrv returns ECONNREFUSED on Windows since v24.13.0 (still broken in v25.x and v26.x)[/+]on May 11, 2026 I tested this again on the latest Node.js 26 release, and the issue is still present.
Environment:
- Windows
- Node.js v26.x
dns.resolveSrv()still returnsECONNREFUSEDexactly like in previous reports.Reacted by Niridya, Peter Wan, Sunjay Kumar, Drew Johnson, Ryan Kast, James Ross and RenanReacted by Drew Johnson and Ryan KastThis also seems to impact other
resolvefunctions too, likeresolveMx:require('dns').resolveMx('example.com', console.log)
- Node.js 24.15.0 response:
Error: queryMx ECONNREFUSED example.com - Node.js 24.12.0 response:
null [ { exchange: '', priority: 0, type: 'MX' } ]
And even just:
require('dns').resolve('example.com', console.log)
- Node.js 24.15.0 response:
Error: queryA ECONNREFUSED example.com - Node.js 24.12.0 response:
null [ '172.66.147.243', '104.20.23.154' ]
Reacted by Niridya, Sunjay Kumar, alexhcj, Renan and Drew JohnsonReacted by Drew Johnson- Node.js 24.15.0 response:
@niridya I created the fix here:
But it needed to be fixed upstream, which c-ares team already did, but they still haven't released the latest changes, I created the issue to follow up when it will be released:
This is what I've been doing for now:
Reacted by Niridya, Drew Johnson, rtritto, Peter Wan and Sunjay KumarThanks for the update and for tracking this upstream.
That explains why I'm still seeing the issue on the current public Node.js v26.x release. I'll keep an eye on the c-ares release and the related PRs.
Reacted by Drew Johnson and Peter WanI was using 26.3.0 version and the following command
node -e "require('dns'); console.log(require('dns').getServers())"would result in[ '127.0.0.1' ].I switched to the previously installed version
24.12.0for a correct DNS query, i.e.,[ '192.168.1.1' ].- added 2 commits that reference this issue
on Jun 15, 2026 Ran into this exact issue on Windows while connecting to MongoDB Atlas over a mobile data hotspot connection. Node's resolver completely fails on the SRV lookup, throwing
ECONNREFUSED.For anyone looking for an immediate programmatic workaround in their code without changing their OS environment, you can force Node's engine to use public Google/Cloudflare servers at the application entry point.
Placing this snippet at the absolute top of the entry file (before any database initialization) completely resolves the
ECONNREFUSEDfailure:const dns = require("node:dns"); dns.setServers(["1.1.1.1", "8.8.8.8"]);
Reacted by Sunjay Kumar, Drew Johnson, Divyam and ArnavJust a quick follow-up: according to the upstream c-ares issue, the fix has now been released in c-ares 1.34.7.
Hopefully this unblocks the Node.js side of the fix. Thanks again for tracking this upstream.
Reacted by Sunjay Kumar, Divyam, rtritto, Drew Johnson and NiridyaReacted by Peter Wan, Drew Johnson and NiridyaI can confirm that this issue is no longer reproducible on the public Node.js v26.5.0 release on Windows. 🎉
I also tested the latest active LTS releases:
- v24.18.0: still reproducible
- v22.23.1: still reproducible
So at the moment, this appears to be fixed in the v26.x release line, while the current LTS release lines are still affected.
Reacted by Niridya, Drew Johnson, Sunjay Kumar and alexhcjQuick update after testing the latest releases:
- ✅ Fixed in Node.js v26.5.0
- ✅ Fixed in Node.js v24.19.0
- ❌ Still reproducible in Node.js v22.23.2
⚠️ Still reproducible in Node.js v25.9.0, but this release line is now End-of-Life.
Reacted by GiaBao, Jashanpreet Singh, Niridya and alexhcjQuick update:
- ✅ Fixed in Node.js v26.5.0
- ✅ Fixed in Node.js v24.19.0
- ✅ Node.js v22.23.3 now includes c-ares v1.34.8, which contains the upstream fix.
I wasn't able to reproduce the issue on my new PC to independently confirm the fix on v22.23.3, but since the c-ares version containing the fix is now included, there shouldn't be any reason for the issue to persist.
Reacted by Niridya, Sunjay Kumar and Danton


Version
v24.14.0, v25.8.1
Platform
Subsystem
dns (c-ares)
What steps will reproduce the bug?
Run the following script:
Run with Node.js >= v24.13.0 on Windows.
How often does it reproduce? Is there a required condition?
100% reproducible on Windows.
No special conditions required.
What is the expected behavior? Why is that the expected behavior?
The SRV query should resolve successfully and return records.
Example output (Node v24.12.0 and v25.2.1):
This behavior is consistent with:
What do you see instead?
This happens consistently even with valid public DNS resolvers configured on the system.
Additional information
This appears related to the issue described in #61435 and the fix in #61453 (commit 17b363a).
However, the problem persists on Windows.
From testing:
Node.js 24:
Node.js 25:
The issue is 100% reproducible and specifically affects SRV resolution (
dns.resolveSrv).The issue does not occur in earlier versions and is therefore a regression.
This suggests the fix may be incomplete or that the regression was reintroduced.