MongoDB querySrv ENOTFOUND / ECONNREFUSED Error
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. Verify the hostname and cluster
- Copy the string again from Connect > Drivers
- Confirm the cluster exists and is not paused; Free clusters auto-pause after 30 days of inactivity
Did this fix it?2. Test the SRV record
- Run dig SRV _mongodb._tcp.<host> or nslookup -debug -q=SRV _mongodb._tcp.<host>
- The answer should list one record per node
Did this fix it?3. Change DNS
- Switch your network DNS to a public resolver that supports SRV, such as Google Public DNS (8.8.8.8)
- Disconnect VPN and retry
Did this fix it?4. Use the standard string
- In the Connect dialog turn off the SRV Connection String toggle and use the mongodb:// URI
- 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 usThe same problem in other apps
All not loading, error messages & connection guides →
- Supabase Max Client Connections Reached (Supabase)
- Firebase auth/invalid-api-key Error (Firebase)
Other MongoDB Atlas errors
- MongoDB Atlas Connection Timed Out (IP Not Whitelisted)
- MongoServerSelectionError: Fix for MongoDB Atlas
- MongoDB Atlas Authentication Failed (bad auth)
- MongoDB Atlas Free Tier (M0) Limits and Throttling
- MongoDB Atlas Cluster Paused (Resume or Auto-Pause)
- MongoDB Atlas Unexpected Bill: Why It's So High
- MongoDB Atlas Too Many Connections Error
- MongoDB Atlas AWS VPC Peering Not Connecting