Conenction Error DNSProtocol Error

Greetings,
When trying to connect to the cluster from mongo shell, I am getting the following error:

$ mongo “mongodb+srv://sandbox-otvws.mongodb.net/test” --username m001-student

DNSProtocolError: Invalid record 0 of SRV answer for "_mongodb._tcp.sandbox-xxxxx.mongodb.net": Incorrect result size
try 'mongo --help' for more information

My mongo shell version is 4.2.1.

Please advise, thank you!

Hi @Joshua_61412,

It could be a temporary issue. I am able to connect to your cluster. Can you please try to connect again using this connection string ?

mongo "mongodb+srv://sandbox-otvws.mongodb.net/test" --username m001-student -p m001-mongodb-basics

Hope it helps!

Please feel free to get back to us if the issue still persists.

Thanks,
Shubham Ranjan
Curriculum Support Engineer

Hi, I get the same error with
mongo “mongodb+srv://Cluster0.mongodb.net/admin” --username m001-student -p m001-mongodb-basics
DNSProtocolError: No SRV records for “_mongodb._tcp.cluster0.mongodb.net”
try ‘mongo --help’ for more information
however I am able to connect with your connect string.
Thanks
Shahrouz

Hi @Shahrouz_Darvishzade,

This error is happening due to the connection string, it’s incorrect.
Can you try connecting with your correct connection string?

You can find it in the connection tab of your Atlas cluster.

Hope it helps!

Please feel free to get back to us if the issue still persists.

Thanks,
Kushagra

Hi, you mean
mongo “mongodb+srv://m001-student:m001-mongodb-basics@Cluster0.mongodb.net/admin”
it didn’t work either. I tried a lot of combinations. none of them works
Shahrouz

Hi @Shahrouz_Darvishzade,

At the place of cluster0 there must be the legit value which will be the host[:port]

I will suggest you to go and watch Chapter 1: What is MongoDB? Atlas User Interface Overview in M001.

You have to create your own cluster visit the connection tab and then copy your free atlas cluster’s connection string.

Thanks,
Kushagra

Thank you but it is the name of my cluster=Cluster0
mongo “mongodb+srv://:@.mongodb.net/admin”
is copied from you site. is this wrong?
image

and here your own lesson to connect

8|

Press the CONNECT button to find your cluster address.

OK thank you very much it is working now!

Hi @Shahrouz_Darvishzade,

We are glad that it worked. In case any queries, feel free to get back to us.

Thanks,
Kushagra