MongoDB querySrv ENOTFOUND / ECONNREFUSED Error

Share
Workaround available Node.js, Mongoose, Python Updated November 13, 2026Based on 3 user reportsHow we research

Quick answer

querySrv errors mean DNS could not resolve your mongodb+srv hostname. Fix by checking the cluster exists, changing DNS to a resolver that supports SRV, or using the non-SRV connection string.

Most likely fix: Verify the hostname and cluster

How to fix it

Try these in order — the most common fix is first.

  1. 1. Verify the hostname and cluster

    1. Copy the string again from Connect > Drivers
    2. Confirm the cluster exists and is not paused; Free clusters auto-pause after 30 days of inactivity
    Did this fix it?
  2. 2. Test the SRV record

    1. Run dig SRV _mongodb._tcp.<host> or nslookup -debug -q=SRV _mongodb._tcp.<host>
    2. The answer should list one record per node
    Did this fix it?
  3. 3. Change DNS

    1. Switch your network DNS to a public resolver that supports SRV, such as Google Public DNS (8.8.8.8)
    2. Disconnect VPN and retry
    Did this fix it?
  4. 4. Use the standard string

    1. In the Connect dialog turn off the SRV Connection String toggle and use the mongodb:// URI
    2. Update outdated drivers
    Did this fix it?

Symptoms

Error: querySrv ENOTFOUND _mongodb._tcp.cluster0.xxxxx.mongodb.net, querySrv ECONNREFUSED, or 'DNSHostNotFound: Failed to look up service'.

Why it happens

  • Typo in the cluster hostname
  • Cluster paused or deleted
  • ISP, VPN or router DNS blocks SRV lookups
  • Old driver without SRV support
  • Offline or restricted network

This guide also covers

  • querysrv enotfound mongodb
  • mongodb querysrv econnrefused
  • querysrv enotfound _mongodb._tcp
  • mongodb srv dns error

Still not working?

If MongoDB Atlas keeps failing, you're not alone. See every MongoDB Atlas problem users report or the alternatives people switch to.

Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.

Talk to us
Fixed it? Share this guide

The same problem in other apps

All not loading, error messages & connection guides →

Other MongoDB Atlas errors

All 10 MongoDB Atlas errors and fixes →