On Sunday I completed a new Pihole installation and everything seemed to be working just fine.
Actual Behaviour:
I get back today on Friday and suddenly Pihole can't resolve any DNS's. I have been troubleshooting for hours with no luck and really need to get my family back on the internet.
Debug Token:
ca3pgo9305
I have performed a repair to pihole. Also oddly, my dashboard indicates it is blocking 9 domains when it should be more like 800,000. Also, the cpu on my pi never drops below 25% and pihole is the only thing I have installed on the Pi.
Most if the checks are ok. The only ones that seem to not work are:
Check connectivity and name resolution on a client PC (can be Linux, Windows or Mac):
C:\>nslookup pi.hole 192.168.0.139
Server: raspberrypi
Address: 192.168.0.139
DNS request timed out.
timeout was 2 seconds.
DNS request timed out.
timeout was 2 seconds.
DNS request timed out.
timeout was 2 seconds.
DNS request timed out.
timeout was 2 seconds.
*** Request to raspberrypi timed out.
Check if clients are configured with the correct DNS server (should be only one DNS server):
For most Linux distroβs including MacOS:
pi@raspberrypi:~ $ cat /etc/resolv.conf
# Generated by resolvconf
domain lan
nameserver 127.0.0.1
I noticed your name server was the address of your pi, so I changed mine likewise. Now instead of looking like yours, the address changed from ::1#53 to 127.0.0.1#53. Any idea why that is?
Now here is some strangeness. I ran the nslookup on my pc again and it timed out once, then said
DNS request timed out.
timeout was 2 seconds.
Server: UnKnown
Address: 192.168.0.139
DNS request timed out.
timeout was 2 seconds.
Name: pi.hole
Address: 192.168.0.139
Why is server UnKnown now and why did it time out once before responding?
I ran nslookup again and it times out twice and gave the same unknown server and address as directly above. I ran it a third time and it timed out all 4 times.
I ran it a few more times and the behavior was erratic. Sometimes it would respond that the server and address were raspberrypi and 192.168.0.139 respectively (and correctly) but still timed out 3 or 4 times. Regardless it is strange and inconsistent.
Another note, I ran "top" on the Pi and it showed that dnsmasq was using nearly 100% %CPU. This seems to jive with the 25% constantly shown in on the Pi desktop graph (1 of 4 CPU's is constantly near 100%). Is this normal? I would think not. It could also explain why DNS times out at times and doesn't at others.
You were suppose to run that one on a Linux or Mac client PC, not on the Pi-hole host.
As the "raspberrypi" host is already running its own DNS server (dnsmasq), its configured to query its own localhost interface IP address for DNS lookups.
For ipv4 this is "127.0.0.1".
For ipv6 this is "::1".
Dnsmasq is configured to listen to both the ipv4 and ipv6 addresses so it doesnt really matter if you configure the ip4 or the ip6 address.
And "/etc/resolv.conf" is populated by the "resolveconf" process, as mentioned in the same file, chances are at next reboot, it reverted back to "::1".
Tail the logs to see whats keeping dnsmasq so busy:
[i] Default IPv4 gateway: 192.168.0.2
192.168.0.2
* Pinging 192.168.0.2
192.168.0.2...
[β] Gateway did not respond. (https://discourse.pi-hole.net/t/why-is-a-default-gateway-important-for-pi-hole/3546)
Is this the correct gateway? Reconfigure with pihole -r if not.
[β] Failed to resolve www.appleidonline.info via Pi-hole (192.168.0.139)
The Pi-hole couldn't connect to its own IP address. This possibly indicates a larger network issue.
Some of the blocked domains start with -, which is an invalid way to start a domain. Check your block lists and remove the lists with the invalid domains.
I tried poking around and nothing was working, though everything seemed correct. I disabled DHCP on Pihole and switched back to DHCP on my router and everything immediately worked again. I'm back to blocking ads and everything is back to normal.