Host name clarification in connection string

Hi ,
I have one small question , While connecting from Mongo compass to the replica set the connection string i get from atlas is below :
mongodb+srv:// username : @sandbox.rdotr.mongodb.net/test

Now my question is
sandbox.rdotr.mongodb.net : Is this a replica set name ? because i am not able to find this DNS anywhere in the configs. and the DNS of each replica set ( PSS ) setup also different not macthing with this DNS.

You might be interested in

So sandbox.rdotr.mongodb.net is not a host name but there is a TXT DNS entry that gives some of the configuration.

: steevej @ asus-laptop ; dig any sandbox.rdotr.mongodb.net

; <<>> DiG 9.16.1 <<>> any sandbox.rdotr.mongodb.net
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 48877
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;sandbox.rdotr.mongodb.net.	IN	ANY

;; ANSWER SECTION:
sandbox.rdotr.mongodb.net. 59	IN	TXT	"authSource=admin&replicaSet=atlas-hfurp1-shard-0"

;; Query time: 50 msec
;; SERVER: 192.168.2.1#53(192.168.2.1)
;; WHEN: Tue Feb 09 07:47:01 EST 2021
;; MSG SIZE  rcvd: 115

To find the DNS SRV (seed list) records you need to do some name mangling and lookup for:

: steevej @ asus-laptop ; dig any _mongodb._tcp.sandbox.rdotr.mongodb.net

; <<>> DiG 9.16.1 <<>> any _mongodb._tcp.sandbox.rdotr.mongodb.net
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 13039
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;_mongodb._tcp.sandbox.rdotr.mongodb.net. IN ANY

;; ANSWER SECTION:
_mongodb._tcp.sandbox.rdotr.mongodb.net. 59 IN SRV 0 0 27017 sandbox-shard-00-00.rdotr.mongodb.net.
_mongodb._tcp.sandbox.rdotr.mongodb.net. 59 IN SRV 0 0 27017 sandbox-shard-00-01.rdotr.mongodb.net.
_mongodb._tcp.sandbox.rdotr.mongodb.net. 59 IN SRV 0 0 27017 sandbox-shard-00-02.rdotr.mongodb.net.

;; Query time: 50 msec
;; SERVER: 192.168.2.1#53(192.168.2.1)
;; WHEN: Tue Feb 09 07:50:20 EST 2021
;; MSG SIZE  rcvd: 239

With this you know the servers, the hosts, (3 in this case) that makes your replica set.

1 Like