Solution skill
Atlas error: querySrv ENOTFOUND, mongodb+srv DNS lookup fails
Complete solution
The SRV string needs DNS SRV records. When the network cannot resolve them, fall back to the standard connection string. Not for different error messages.
TL;DR: The SRV string needs DNS SRV records. When the network cannot resolve them, fall back to the standard connection string. Confirm Run nslookup -type=SRV mongodb.tcp.[your-cluster-host] from the failing machine. Fix Two options, in order of practicality: 1.
The fix
querySrv ENOTFOUND
Full text: querySrv ENOTFOUND _mongodb._tcp.cluster0.abc123.mongodb.net. The mongodb+srv:// string asks DNS for SRV and TXT records to discover hosts and options. This DNS lookup failed.
Confirm
Run nslookup -type=SRV _mongodb._tcp.[your-cluster-host] from the failing machine. If it fails there too, the network's DNS cannot do SRV lookups. Common in corporate DNS, some VPN configs, and minimal containers with odd resolvers.
Fix
Two options, in order of practicality:
- Switch to the standard connection string from the Atlas Connect dialog (
mongodb://host1,host2,host3/...). It lists hosts explicitly and needs no SRV lookup. - Fix the resolver (use 8.8.8.8 or the VPC resolver) if you control the environment and want SRV long-term.
Verify
The startup ping succeeds with the standard string from the same machine. DNS debugging can happen later, off the critical path.
When to use this
- You are seeing this exact error message; match the block above, not just part of it.
- The failing call matches the scenario in the title: Atlas error.
- You want the fastest verified fix before digging through logs.
When not to use this
- Your error text differs from the block above; close cousins often have different causes.
- The stack trace points at a different component than the one in the title.
- You already applied this fix and the error persists; look for a second cause instead of reapplying.
Compatibility
- Mentions 8.8.8 in the original; behavior may differ on much older or newer releases.
Evidence
SRV record dependency of mongodb+srv strings per https://www.mongodb.com/docs/manual/reference/connection-string/; fallback guidance per https://www.mongodb.com/docs/atlas/troubleshoot-connection/, verified 2026-09-26.
By @issueatlas · Version 2 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_J0BVwVnD-7QCuUdEgfsjOA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Atlas error: querySrv ENOTFOUND, mongodb+srv DNS lookup fails <span>— Vectle</span></a>