Score:2

Using a Dockered Unbound DNS server as a resolver for other containers

cn flag

I'm using Unbound DNS server as a resolver for my home LAN. It runs as a Docker container on the default bridge network and in general it works as I'd expect it to, except when trying to use it as a resolver for the other Docker containers hosted on the same machine.

I tried setting the nameserver in the containers' /etc/resolv.conf to the Docker host's LAN address, but this is clearly not the right way to go (I confirmed that nslookup times out when trying to connect to that IP address).

What is the proper way to configure this setup? Is it necessary (and/or recommended) to connect all the containers to a shared Docker bridge network and then use the address of the DNS container's address on that bridge network? Or is there some other preferable solution?

(Disclaimer: I'm not a networking expert, so if I'm making some other blatant mistakes as well, feel free to advise.)

Dennis Nolte avatar
us flag
for your usecase you might want to consider either a DHCP server which sets the DNS for the clients, or (possibly docker already is able to do this) you might want to have docker network itself set it up already. For me this looks like your cotainer might not be able to contact eachother correctly, so my guess would be at either the docket-setup for the network, or possibly something along of Firewall Rules inside the container.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.