roadmap icon indicating copy to clipboard operation
roadmap copied to clipboard

Docker Network DNS via Container

Open ttfkam opened this issue 2 years ago • 0 comments

Tell us about your request I would like to be able to set up a DNS server container and set the DNS for the associated Docker network (DHCP) to point to that DNS container rather than use the host's DNS or the global settings for the entire engine.

Which service(s) is this request for? Docker Engine and docker-compose

Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard? It's possible now if every container is manually configured. Would rather be able to set it by network config such as in a docker-compose.yml file where a container provides DNS and other containers within that Docker network can reference that DNS service container.

The DNS service container would then use the global Docker engine's DNS configuration (for relaying, for example).

This can technically be done today, but only in a fairly brittle way and after a lot of manual tweaking of each and every service listed in the docker-compose.yml file.

When stubbing out services, it's helpful to avoid changing code when all you really want is that email endpoint to point to a dummy rather than the real thing or for calls to AWS to stay in your sandbox.

Support pointed me toward the engine config doc, but that is a global setting that affects all containers rather than a single docker network. Disabling TLS verification is generally trivial, but entire hostnames that may be hard-coded into 3rd party libraries can be a deal breaker sometimes.

Are you currently working around the issue? Requires a change where the entire Docker environment on a box has to use the same DNS or each container has to have escape code to avoid calling the real service, which in some languages and environments is non-trivial and time consuming to implement cleanly.

Additional context

ttfkam avatar Feb 16 '23 18:02 ttfkam