Comment on Running DNS server in Docker
fendrax@jlai.lu 6 months agoFor some reason, I am only seeing this comment thread now, so sorry for the late response.
Thanks for those valuable details. But I am still a bit confused. I understand why you are saying that pi hole should be the only DNS server handling requests sent by LAN devices (including the machine hosting the DNS). That’s because it is the only one which can resolve local names (well, that’s actually its upstream dnsmasq running as a sibling container that does that but that’s a minor detail).
But then you say there should be another DNS server to solve my problem. If I put two server entries in /etc/resolv.conf
, one being pi hole and the other my ISP’s DNS, the two of them will be randomly picked by DNS clients. When the ISP’s is used, it will fail to translate local names. I guess there is a way to let the client try the other server after a failure but it will add some undesirable latency.
Sorry if I misunderstood your point but after reading the first comments I was quite convinced by the idea of adding a second nameserver
entry in /etc/resolv.conf
. Your explanations convinced me otherwise and now I have the impression that I can’t really solve my initial problem in a reliable way.
AtariDump@lemmy.world 6 months ago
You should have two PiHoles.
fendrax@jlai.lu 6 months ago
My goodness, that’s some impressive responsiveness ^^
I guess see your point. But then the problem shifts to the upstream dnsmasq instance which acts as DHCP + DNS for the local devices. This is the server ultimately able to translate local names.
I don’t think it’s doable to have two instances of dnsmasq that are able to translate local names interchangeably. That would require two DHCPs to have authority on the network. But I’m no expert so I may be missing something obvious.
AtariDump@lemmy.world 6 months ago
You only set one as a DHCP server. DHCP hands out both PiHoles as DNS servers on the network.
Name resolution is handled by DNS and not DHCP.
fendrax@jlai.lu 6 months ago
Sorry, I was unclear: I use dnsmasq as single source of truth. In its DHCP config, I set machine names, routes and all. And this is because this dnsmasq is the DHCP that it knows how to translate the names of the devices it configured. Pi-hole forwards all DNS requests to dnsmasq. Now if I use two instances of dnsmasqs, only one can be a DHCP and the other won’t know how to resolve local names, unless it uses the first dnsmasq as upstream. But in scenarios where this first dnsmasq instance is down, we are back to square one.