Error while connecting to the monogdb

I am getting this error can anyone help?

Error: querySrv ETIMEOUT _mongodb._tcp.cluster0.11oatej.mongodb.net
at QueryReqWrap.onresolve [as oncomplete] (node:internal/dns/promises:251:17) {
errno: undefined,
code: ‘ETIMEOUT’,
syscall: ‘querySrv’,
hostname: ‘_mongodb._tcp.cluster0.11oatej.mongodb.net’
}
Here is the screenshot of that

1 Like

Hey @Harshil_K_Dangar_20BECE30024,

Welcome to the MongoDB Community!

It seems like the DNS issue, try using Google’s DNS 8.8.8.8 and 8.8.4.4. 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.

Regards,
Kushagra

1 Like

solved the error by downgrading the node version as you can see below and everything is working fine

1 Like