Cannot reach cluster: ECONNREFUSED, timeout, or auth failed.
Wrong connection-string shape, IP not allowlisted, or DNS/resolver trouble.
mongodb+srv://user:pass@cluster.x.mongodb.net/db# Atlas: Network Access -> add your egress IP or 0.0.0.0/0 for testingdig _mongodb._tcp.cluster.x.mongodb.net SRVStatic egress IP + allowlist; never leave 0.0.0.0/0 in production.
Spinning up a fresh box to reproduce or escape this error?
Managed cloud hostingNinjaOps publishes free engineering guides. Some outbound links are affiliate links: they cost you nothing and support the site.
Last reviewed 2026-10-02 · NinjaOps SEO grid · DevOps blog