Docker-like private DNS name lookup for private IPs?

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? Thanks


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.


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].

[1] [2] [3] [4]