Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

3K
Vistas
Error: querySrv ENOTFOUND _mongodb._tcp.dbname.fzofb.mongodb.net

I'm learning Node.js and just started working with MongoDB.

I'm making a connection with the MongoDB Cluster I've created

const dbURI = 'mongodb+srv://testuser:test1234@nodelearning.fzofb.mongodb.net/mydb?retryWrites=true&w=majority';
mongoose.connect(dbURI, { useNewUrlParser: true, useUnifiedTopology: true })
    .then((result) => console.log('connected to db'))
    .catch((err) => console.log(err));

When I run it nodemon app I get this error:

Error: querySrv ENOTFOUND _mongodb._tcp.mydb.fzofb.mongodb.net at QueryReqWrap.onresolve [as oncomplete] (node:dns:206:19) { errno: undefined, code: 'ENOTFOUND', syscall: 'querySrv',
hostname: '_mongodb._tcp.mydb.fzofb.mongodb.net' }

over 4 years ago · Santiago Trujillo
3 Respuestas
Responde la pregunta

0

The error indicates that there is no error in the code. This leaves you with three potential possibilities:

  1. Ensure you have MongoDB installed on your computer.
  2. Make sure you're connected to wifi that is not public.
  3. Make sure you have allowed the IP in network access of MongoDB as shown in the image below:

enter image description here

In my case, I was connected to public wifi in a coworking space. I change my connection to my personal hotspot and it worked.

over 4 years ago · Santiago Trujillo Denunciar

0

Also if you have your mongodb Atlas cluster inactive after a while. It could get paused and then when you run a server it returns the error you had.

So another bet is to login to your Atlas account and confirm if it hasn't been paused. Well this option of mine should only be considered after trying the options above.

over 4 years ago · Santiago Trujillo Denunciar

0

You need to convert special characters in connection string password to percent encoding.

I had the same issue with mongodb-compass. For me it was incorrect connection string format. So in my case it required to convert @ symbol in my password to %40 (percent encoding).

You can read more about this in here. and here.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda