0

iam new to mongoDB 4.1. and tried to connected it, but iam getting error when tried to connected appologize for my english.

here's my error, i'am running on xubuntu

Error: queryTxt ESERVFAIL cluster0.we5ri9d.mongodb.net
    at QueryReqWrap.onresolve [as oncomplete] (node:internal/dns/promises:251:17) {
  errno: undefined,
  code: 'ESERVFAIL',
  syscall: 'queryTxt',
  hostname: 'cluster0.we5ri9d.mongodb.net'
}

can I get an explanation about the error there, I'm asking a question because the tutorial video that I watched didn't get an error message with the above code or to anyone who can solve the above error code:

const connect = async () => {
  try {
    await mongoose.connect(process.env.MONGO_URI);
    console.log("Connected to MongoDB!");
  } catch (error) {
    throw error;
  }
};

|the error I got was paused for a few seconds because it was asynchronous and then the error appeared. Obviously I'm asking this because I just started going to the backend

mhmdfrhn
  • 1
  • 1
  • Failure to resolve the TXT record and failure to resolve the SRV record have the same cause, see: https://stackoverflow.com/a/68903530/2282634 – Joe Apr 04 '23 at 19:02
  • i got it now, and its working fine in my locale by changing nodejs and dns version. Thank You – mhmdfrhn Apr 05 '23 at 12:39

0 Answers0