Can't connect with DNS Seedlist Connection Format but works fine with standard connection string

Viewed 674

I am trying to connect to my atlas cluster but it gives me time out error. I tried connecting to local mongodb, it works and using standard connection string for the same cluster:

(mongo "mongodb://cluster0-shard-00-00-n1kmr.mongodb.net:27017,cluster0-shard-00-01-n1kmr.mongodb.net:27017,cluster0-shard-00-02-n1kmr.mongodb.net:27017/test?replicaSet=Cluster0-shard-0" --ssl --authenticationDatabase admin  --username <username> --password <password>)

works too!

However, when I try to connect with DNS Seedlist Connection Format, it gives me a timeout error when I run

mongo "mongodb+srv://cluster0-n1kmr.mongodb.net/test"  --username <username>

Error message: DNSHostNotFound: Failed to look up service "":This operation returned because the timeout period expired. cmd line image with error message

My mongo shell version is v4.2.6

>>mongo --version
MongoDB shell version v4.2.6
git version: 20364840b8f1af16917e4c23c1b5f5efd8b352f8
allocator: tcmalloc
modules: none
build environment:
    distmod: 2012plus
    distarch: x86_64
    target_arch: x86_64

and db version v4.2.6

>> mongod --version
db version v4.2.6
git version: 20364840b8f1af16917e4c23c1b5f5efd8b352f8
allocator: tcmalloc
modules: none
build environment:
    distmod: 2012plus
    distarch: x86_64
    target_arch: x86_64
0 Answers
Related