Docker Community Forums

Share and learn in the Docker community.

Add A records to Docker's Internal DNS


(Ktwalrus) #1

Not sure if this is currently possible in Docker 1.12, but I would like to be able to add A and CNAME records into Docker’s Internal DNS so services that are external to the current swarm can be discovered by the containers running on the current swarm.

I’m planning on deploying 2 Swarms that are completely separate (one swarm on bare metal and the other in the cloud). I need a way for the services/containers in each swarm to be able to discover/use some services/containers in the other Swarm. I could deploy my own DNS external to each swarm and make these swarm’s update the DNS with the appropriate VIPs, but it would be more robust if I could have each swarm add the A records to each internal DNS (that Docker already makes highly available within the Swarm). In fact, my apps currently update my Cloudflare DNS for such discovery, but this DNS is public and I’d prefer not to expose these IPs to the internet.

I may also deploy some databases on bare metal (or in separate cloud vms) outside either Swarm and I would like an easy way to communicate the VIP to contact the database to each of my Swarms.