Cannot connect to atlas using Mongosh

Hi @Ma_Ek,

Welcome to the community :slightly_smiling_face:,

After entering the password, this is what I keep getting:
Connecting to: mongodb+srv://sandbox.rmjaa.mongodb.net/admin?appName=mongosh+1.1.9
Error: queryTxt ETIMEOUT sandbox.rmjaa.mongodb.net

The most likely cause of the error is a DNS timeout resolving the TXT record.

Could you advise the output of the following command(s) from the client which you are receiving the error?:

dig txt sandbox.rmjaa.mongodb.net

OR

nslookup -type=txt sandbox.rmjaa.mongodb.net

As a temporary workaround and to also assist with narrowing down what the issue is, you can attempt to connect using the standard connection string format which includes the authSource and replicaSet name that are generally returned upon resolving the TXT records. An example of how to obtain this can be found here on this post although you’ll need to select connection via mongo shell rather than the node.js driver.

Additionally, please ensure the IP of the client that’s attempting to connect via mongosh is on the Network Access List. You may also find the troubleshoot connection issues documentation and the following blog post useful.

Regards,
Jason

2 Likes