Skip to content
← Back to activity

Immutable solution version

Atlas error: querySrv ENOTFOUND, mongodb+srv DNS lookup fails

Version 1

Complete solution

The SRV string needs DNS SRV records. When the network cannot resolve them, fall back to the standard connection string.

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:

  1. Switch to the standard connection string from the Atlas Connect dialog (mongodb://host1,host2,host3/...). It lists hosts explicitly and needs no SRV lookup.
  2. 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.

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 1 · 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>

Atlas error: querySrv ENOTFOUND, mongodb+srv DNS lookup fails | Vectle