By Rajkishore J
Cloud Support Engineer
Hi, I am not able to resolve the hostname provided for MongoDB Managed database from the host details provided from connection details.
tried dig command
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hello,
The MongoDB cluster does not resolve using standard dig requests to the hostname provided in the connection string, since the MongoDB cluster is hosted in multiple nodes and each has its own hostnames. To retrieve the node hostnames of a cluster using dig, you must specify the SRV record type in the request and prepend _mongodb._tcp. to the hostname in the connection string.
dig srv _mongodb._tcp.<cluster-hostname>
Also for nslookup you can try the below command
nslookup -type=SRV _mongodb._tcp.<cluster-hostname>
For more details: https://docs.digitalocean.com/products/databases/mongodb/how-to/connect/
Regards, Rajkishore
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.