Docker-like private DNS name lookup for private IPs?

Posted June 7, 2020 606 views

I’m relatively new to nearly everything with web development, but I’ve been playing around with Docker recently. While my local environment is basically a bunch of Docker images interconnected, my actual production environment is going to spread out among multiple servers so I can better load balance and scale.

My question is, docker allows you to use the name of the docker image as a stand-in for IP addresses, since it has an internal DNS server that will resolve them to the correct IP on the subnet.

For example, using redis:6379 instead of [redis server IP]:6379 because internally, ‘redis’ resolves automatically to the correct private IP via Docker’s DNS.

So what I’m wondering is, does Digitalocean offer an inbuilt functionality for something like this? Or will I have to host my own DNS server for my droplets that redirects to their private IP’s as needed?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer


What you are looking for is a service discovery tool like Hashicorp’s Consul [1] or Netflix’s Eureka [2].

If you’re using Kubernetes, you can reference their services using a DNS [3].

If you’re using Hashicorp’s Nomad, it comes with Consul integration built in [4].