DNS - How to use Azure custom DNS with MongoDB in Atlas

Hello All,

Our App runs at Azure with Mongo on Atlas and I am wondering how to set a custom domain name (DNS) at azure to our Atlas Cluster DB.

Ex: in my APP we will use ( mongo-db-00.linkle.io / mongo-db-01.linkle.io / mongo-db-02.linkle.io ) and the Azure DNS will point to the correct Mongo DB in Atlas.

Thank you
M.

Hi Marcelo,

This concept is generally to be avoided because MongoDB uses client-side load balancing and primary-discovery within the driver tier: Basically the MongoDB driver powering your application will ask the MongoDB Atlas cluster what it believes its hostnames to be as well as which node is currently the Primary for taking writes. If you add a layer of indirection here this introduces risk: the driver will discovery the cluster’s identity and start using the cluster hostnames and you might not realize that you could be in a degraded availability state. Note for completeness that MongoDB Sharded clusters – where you connect through a set of mongos’s – are less susceptible to these issues.

Bottom line here is I highly recommend you keep it simple and use the built-in Atlas cluster hostnames.

Cheers
-Andrew

2 Likes

Hello Andrew, thank you.

I will keep simple.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.