Error while connecting to mongoDB


Error: querySrv ETIMEOUT  
    at QueryReqWrap.onresolve [as oncomplete] (node:internal/dns/promises:251:17) {
  errno: undefined,
  code: 'ETIMEOUT',
  syscall: 'querySrv',
  hostname: ''

Node.js v20.5.1
[nodemon] app crashed - waiting for file changes before starting...

Hey @sadiq_abdulwahab,

Welcome to the MongoDB Community! :star2:

It seems like the DNS issue, try using Google’s DNS and Please refer to the Public DNS for more details.

Apart from this, please refer to this post and try using the connection string from the connection modal that includes all three hostnames instead of the SRV record.

If it returns a different error, please share that error message here.

In addition to the above, I would recommend also checking out the Atlas Troubleshoot Connection Issues documentation.

Best regards,