Interview Prep/Docker/Networking and Compose

Which DNS settings do you adjust when containers cannot resolve internal company hosts?

IntermediateScenarioNetworking and Compose
Answer

Situation read → Containers on user-defined networks use Docker's embedded DNS at 127.0.0.11, forwarding to the host's resolvers; with systemd-resolved the host stub 127.0.0.53 is unusable.

What I'd do →

{"dns": ["10.0.0.2"], "dns-search": ["corp.example.com"]}

in daemon.json, or per run --dns 10.0.0.2 --dns-search corp.example.com. Test with docker run --rm busybox nslookup intranet.corp.example.com.

Why → Docker substitutes the real upstream resolvers from /run/systemd/resolve/resolv.conf.

Interview tip → Check VPN split-DNS interactions.

All Docker questions Roadmap: Docker & containers

More on Networking and Compose