Windows-specific DNS SRV resolution issue requiring investigation of c-ares integration.
The issue involves SRV DNS resolution failing consistently on Windows since Node.js v24.13.0, likely related to c-ares integration changes. The problem is reproducible and requires debugging the Windows-specific DNS handling code. The fix may involve changes to the DNS subsystem or c-ares configuration.
v24.14.0, v25.8.1
Microsoft Windows NT 10.0.26200.0 x64
dns (c-ares)
Run the following script:
const dns = require("dns");
dns.resolveSrv("_mongodb._tcp.mongodb.<your-cluster>.mongodb.net", (err, addresses) => {
console.log(err ? `error ${err.code}: ${err.message}` : addresses);
});
Run with Node.js >= v24.13.0 on Windows.
100% reproducible on Windows.
No special conditions required.
The SRV query should resolve successfully and return records.
Example output (Node v24.12.0 and v25.2.1):
[
{
name: 'shard-00-00.<your-cluster>.mongodb.net',
port: 27017,
priority: 0,
weight: 0,
type: 'SRV'
},
{
name: 'shard-00-01.<your-cluster>.mongodb.net',
port: 27017,
priority: 0,
weight: 0,
type: 'SRV'
},
{
name: 'shard-00-02.<your-cluster>.mongodb.net',
port: 27017,
priority: 0,
weight: 0,
type: 'SRV'
}
]
This behavior is consistent with:
error ECONNREFUSED: querySrv ECONNREFUSED _mongodb._tcp.<your-cluster>.mongodb.net
This happens consistently even with valid public DNS resolvers configured on the system.
This appears related to the issue described in #61435 and the fix in #61453 (commit 17b363a66c).
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 theref
Claim this issue to let others know you're working on it. You'll earn 20 points when you complete it!