Watch keynotes and sessions from MongoDB.live, our virtual developer conference.

Mongodb remote database connectivity error - getaddrinfo ENOTFOUND

Created a database in free MongoDB Atlas cloud in AWS, downloaded MongoDB Compass Community in Windows10, testing my connection using Compass. I have pasted my connection string in Compass under “New Connection” tab as : mongodb://my_user:my_pwd@mycluster-u8ha7.mongodb.net:27017/my_db
and clicked “Connect”. I am getting following error: getaddrinfo ENOTFOUND mycluster-u8ha7.mongodb.net.

Can someone pls guide me how to troubleshoot and make this remote connectivity working from my local laptop? Just started playing around with MongoDB. So looking for the initial push to move forward. Thanks in advance.

That does not look like a connection string from Atlas.

You can get one from the connect button on your cluster.

https://docs.atlas.mongodb.com/connect-to-cluster/#connect-to-a-cluster

Thanks Chris for your response. I got the right connect string from Atlas as you have suggested. Initially when I was using mongodb+srv I was getting error, after installing dnspython everything started working. Thanks again.

1 Like