Consul
I like to use the Hashicorp Consul for this. It can run as an installed client or container and provides a DNS interface that you can request from an external Docker device. It also has features such as service discovery and monitoring, and is open source.
https://www.consul.io/docs/agent/dns.html
One of the main query interfaces for the Consul is DNS. The DNS interface allows applications to use service discovery without integration with a highly touchable Consul.
For example, instead of making HTTP API requests to Consul, the host can use the DNS server directly through a name lookup, such as "redis.service.east-aws.consul". This query automatically searches for nodes that provide redis service, are located in the east-aws data center, and do not have any health checks. It's simple!
This may be redundant for what you are looking for, but should do the job.
Dnsmasq
A simpler alternative would be DNSMasq. I am not so familiar with this, but for a really small scale this will let your DNS host know about the launch of containers.
http://www.thekelleys.org.uk/dnsmasq/doc.html
https://hub.docker.com/r/andyshinn/dnsmasq/
source share