Stitch connect to mongodb Atlas,error host name?


Hi, I use stitch plateform to connect mongodb atlas but it error “No address associated with hostname”",then I want to know host name of Atlas.

Hi @thanachot_supawasut

Do you have a link for this? I’m not too familiar with this platform myself. Based off the error itself and the naming convention / format it seems like it’s interpreting an Atlas SRV record as the hostname instead of using the hostnames associated with such record but this is just a guess at this stage.

For example:

ping cluster0.spk7r49.mongodb.net
ping: cannot resolve cluster0.spk7r49.mongodb.net: Unknown host

Since cluster0.spk7r49.mongodb.net is not the actual hostname, I cannot ping it in this case.

Using the nslookup on this srv record with associated prefix I can get the 3 hostnames associated with it:

nslookup -type=srv _mongodb._tcp.cluster0.spk7r49.mongodb.net
Server:		127.0.0.1
Address:	127.0.0.1#53

Non-authoritative answer:
_mongodb._tcp.cluster0.spk7r49.mongodb.net	service = 0 0 27017 ac-trrc202-shard-00-00.spk7r49.mongodb.net.
_mongodb._tcp.cluster0.spk7r49.mongodb.net	service = 0 0 27017 ac-trrc202-shard-00-01.spk7r49.mongodb.net.
_mongodb._tcp.cluster0.spk7r49.mongodb.net	service = 0 0 27017 ac-trrc202-shard-00-02.spk7r49.mongodb.net.

If you’re following any particular connection guide, please send that as well.

Regards,
Jason