Note that this is solved, I am just looking to understand why this setting solves it, and what the alternatives could be.
The issue I am facing:
I switched from AdGuard Home to PiHole recently, for PiHole's support for multiple local DNS records per domain.
When running AdGuard, I set the Raspberry Pi as the upstream DNS resolver for the entire router.
When I switched to PiHole, that did not work at all - it only worked when putting it as the DNS resolver for the router's DHCP config. This configuration seemed significantly slower on all of our devices, though I have no real proof that this configuration was the culprit. Maybe the router is running its own DNS cache that does not get used by the DHCP clients?
Anyway, the setting that finally got it working again with PiHole only as the router's upstream DNS was setting dns.listeningMode
to:
SINGLE
Permit all origins, accept only on the specified interface. Respond only to queries arriving on the specified interface. The loopback (lo) interface is automatically added to the list of interfaces to use when this option is used. Make sure your Pi-hole is properly firewalled!
I am a bit confused why the devices on basic my home network did not qualify for the default setting:
LOCAL (default)
Allow only local requests. This setting accepts DNS queries only from hosts whose address is on a local subnet, i.e., a subnet for which an interface exists on the server.
I do not quite understand what is meant up by “a subnet for which an interface exists on the server”
...and of course whether running with this setting would be any cause for concern.
Details about my system:
Router is 192.168.0.1, all clients receive that IP as their DNS IP when connecting.
PiHole is statically assigned IP 192.168.103.0 by the DHCP server running on my router, which covers my whole local subnet, 192.168.0.2-192.168.255.254.
Wifi is disabled and the Raspberry Pi only uses eth0
- output of ip a
for that is:
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000link/ether dc:a6:32:30:0f:62 brd ff:ff:ff:ff:ff:ffinet 192.168.103.0/16 brd 192.168.255.255 scope global noprefixroute eth0
So the Raspberry Pi - and PiHole are bound to the entire subnet.
The only other non-default thing I am doing is that the Raspberry Pi's local hostname + domain is `rpi.lan` rather than `pi.hole`.
What I have changed since installing Pi-hole:
Just added a few local DNS records for the Pi itself and a TrueNas box.
And of course now changed the dns.listeningMode
setting.