Once the router is set to use Pi-hole for the DNS, all devices using the router for DNS should go through pi-hole and resolve the DNS
Actual Behaviour:
Once the router DNS is set to the pi-hole IP, no devices, including the pi-hole, can resolve DNS (direct IP addresses work fine).
1st, I've been using pi-hole successfully for over a year (it runs on a CentOS 7 machine). The problem started after a recent CentOS update. First, I couldn't get FTL to work. I updated pi-hole (now v4.1.1 and FTL 4.1.2), but that didn't help. I finally got that working so the DNS server would start. However, in the process I might have messed up some setting. If I leave the router to get DNS externally, and I direct a device on my network to use my pi-hole server for DNS, it works as expected (i.e., blocks ads on that device). But once I set the router DNS to pi-hole, nothing can access the internet via names.
To solve the FTL problem, I ended up disabling the libvirtd.service since the log showed a dnsmasq conflict on port 53.
My /etc/resolv.conf (my router is 192.168.123.1, 1st line is actually commented out, but if I add the '#' the post shows it as boldface):
Generated by NetworkManager
nameserver 192.168.123.1
I've tried commenting that out and I've tried setting it to 127.0.0.1, but neither worked. There is also nothing in my /etc/hosts except the default 127.0.0.1 localhost. I've also tried with my firewall disabled - same result.
I also want to switch the DHCP server from my router to pi-hole. Initially, I was thinking I could get everything working before changing the DHCP from my router to pi-hole, but it doesn't seem to matter in this case (and yes, I did disable DHCP on my router after enabling on pi-hole). I do have a # of static IPs on my LAN that I added to the pi-hole DHCP. Only some of them are in my /etc/pihole/lan.list though.
I've been struggling with this for over a week trying various things read on this forum and others and I'm at wits end. Hopefully, someone can help. I can post other config files as needed.
Are you able to resolve DNS using Pi-hole direclty from another device when the router is set to use Pi-hole? Have you tried setting your /etc/resolv.conf to an external DNS server? Make a new debug token please (they expire after 48 hours).
No, once the router points to Pi-hole for DNS nothing can resolve names even if they're pointing at the Pi-hole as well.
I did enable DHCP in Pi-hole. Is it now possible that the router can be set to use an external DNS, but devices on the network that are set to get DNS automatically end up going through Pi-hole? It almost seems like Pi-hole is blocking ads on my devices and certainly non-static IP devices are getting their addresses from Pi-hole, but that doesn't seem possible (maybe showing my lack of knowledge on how DNS works on LANs).
As you have noted, Pi-Hole is properly resolving DNS queries as received - from your debug log:
*** [ DIAGNOSING ]: Name resolution (IPv4) using a random blocked domain and a known ad-serving domain
[✓] warnlng-n0tice-d41.gdn is 0.0.0.0 via localhost (127.0.0.1)
[✓] warnlng-n0tice-d41.gdn is 0.0.0.0 via Pi-hole (192.168.123.250)
[✓] doubleclick.com is 216.58.194.174 via a remote, public DNS server (8.8.8.8)
Let's take a look at the stats for the Pi-Hole. What is the output of these commands from the CentOS7 terminal:
Indeed it appears to be working. The most recent change I made (edit #2 of my original) was to set the contents of /etc/resolv.conf to
nameserver 127.0.0.1
From the results below, you can see that the 3rd top client is my router. So if the router's DNS is set to 9.9.9.9 in this case, how does it end up going to Pi-hole at 192.168.123.250? Considering up until last week it only worked when the router DNS was set to Pi-hole, I'm a little confused as to why it's different. New version perhaps?