Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

1.1K
Views
Error: consultaTxt ETIMEOUT cluster0.dxzhf.mongodb.net

Estoy intentando que npm inicie mi backend pero tengo un error con la conexión a mongodb atlas. aquí está mi código index.js:

 import express from 'express'; import bodyParser from 'body-parser'; import mongoose from 'mongoose'; import cors from 'cors'; const app = express(); app.use(bodyParser.json({limit: "30mb", extended: true})); app.use(bodyParser.urlencoded({limit: "30mb", extended: true})); app.use(cors()); const CONNECTION_URL = "mongodb+srv://Danishbukhari:(mypassword)@cluster0.dxzhf.mongodb.net/myFirstDatabase?retryWrites=true&w=majority" const PORT = process.env.PORT || 5000; mongoose.connect(CONNECTION_URL, { useNewUrlParser: true}) .then(() => app.listen(PORT, () => console.log(`Server running on port: ${PORT}`))) .catch((error) => console.log(error.message) )

y mi paquete.json ser como:

 { "name": "server", "version": "1.0.0", "description": "", "main": "index.js", "type": "module", "scripts": { "start": "nodemon index.js" }, "author": "Danish", "license": "ISC", "dependencies": { "body-parser": "^1.19.1", "cors": "^2.8.5", "express": "^4.17.2", "mongodb": "^4.2.2", "mongoose": "^6.1.2", "nodemon": "^2.0.15" } }

mi pagina de conexion del atlas de mongodb

También incluí mi dirección IP en la lista blanca, por favor dígame cómo resolver este problema :(

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Tuve este problema y cambiar DNS a 8.8.8.8 funcionó para mí.

Pero antes de esto, asegúrate de que:

  1. Comprueba tu conexión.
  2. Apague la VPN.
  3. Lista blanca de IP en mongoDB
  4. Verifique sus credenciales en mongoDB

Buena suerte ;-) Si aún tiene problemas, consulte el enlace

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!