DNS no longer working from router - loop?

Expected Behaviour:

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.

Debug Token: jn1488lt6o

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).

New debug token is dqycxzz2kj.

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:

echo ">stats" | nc localhost 4711

echo ">top-clients withzero (15)" | nc localhost 4711

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?

echo ">stats" |nc localhost 4711
domains_being_blocked 112751
dns_queries_today 32764
ads_blocked_today 5312
ads_percentage_today 16.212917
unique_domains 2517
queries_forwarded 18827
queries_cached 8623
clients_ever_seen 14
unique_clients 10
dns_queries_all_types 32764
reply_NODATA 4818
reply_NXDOMAIN 947
reply_CNAME 6770
reply_IP 11801
privacy_level 0
status enabled
---EOM---

echo ">top-clients withzero (15)" | nc localhost 4711
0 25991 192.168.123.248 mammacubed.mydomain
1 4709 127.0.0.1 localhost
2 1776 192.168.123.1 gateway
3 320 192.168.123.37
4 2 192.168.123.250 galadriel
5 2 192.168.123.87 amazon-21f8a3702.mydomain
6 2 192.168.123.38 amazon-506b21a3e.mydomain
7 1 192.168.123.53 galaxy-s9.mydomain
8 1 192.168.123.240 rachio-295b54.mydomain
9 1 192.168.123.244 gwaihir.mydomain
10 0 192.168.123.128 amazon-7645e0cf0.mydomain
11 0 192.168.123.241 mithrandir_eth.mydomain
12 0 192.168.123.84 mithrandir-2.mydomain
13 0 192.168.123.247 elessar.mydomain
---EOM---

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.