Poweroutage and now dnsmasq appears to not be working correctly
Hi all, I had a day long power outage recently and when the power came back on, the pihole stopped resolving addresses. I ended up switching my router back to default DNS to get my resolutions working again but I'm unable to figure out what's wrong with the pi.
pihole appears to be running, pihole status comes back clear.
/etc/resolv.conf is:
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.0.1
and the debug is showing these issues:
*** [ DIAGNOSING ]: Name resolution (IPv4) using a random blocked domain and a known ad-serving domain
dig: '' is not a legal name (unexpected end of input)
[✗] Failed to resolve via localhost (127.0.0.1)
dig: '' is not a legal name (unexpected end of input)
[✗] Failed to resolve via Pi-hole (192.168.137.181)
[✓] doubleclick.com is 172.217.0.238 via a remote, public DNS server (8.8.8.8)
*** [ DIAGNOSING ]: Pi-hole processes
[✗] dnsmasq daemon is unknown
[✓] lighttpd daemon is active
[✓] pihole-FTL daemon is active
Here's what a dig looks like:
;<<>> DiG 9.9.5-9+deb8u16-Raspbian <<>> google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 503
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1452
;; QUESTION SECTION:
;google.com. IN A
;; Query time: 80 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Tue Sep 25 02:26:32 EDT 2018
;; MSG SIZE rcvd: 39
I'm a bit stumped here. I can't pihole -r without fixing the resolution issues on the pi itself, and I made several unsuccessful attempts to override resolv.conf to get it to 8.8.8.8 or anything else.
Any thoughts would be appreciated.
Edit: I managed to solve the problem. The issue was that the extended poweroutage caused my UPS to eventually go down, and caused the raspi to shut off without a proper shut down. This somehow corrupted the local dnsmasq.
As u/Kriton20 suggested, I looked at how to use the resolvconf package to temporarily change the DNS to 8.8.8.8. I found a comment here that explained how to do this: https://askubuntu.com/questions/130452/how-do-i-add-a-dns-server-via-resolv-conf
The relevant comment:
It sounds like you are talking about the resolvconf package.
Install the resolvconf package.
Run
cd /etc/resolvconf/resolv.conf.d sudo cp -p head head.orig #backup copy, always do this sudo nano head
The top of the file is a scary warning. The file /etc/resolv.conf is autogenerated from the contents of this file; the warning is there so it will get put in /etc/resolv.conf when /etc/resolv.conf is generated. To the end of the file, add
nameserver <ip_of_nameserver>
Press Ctrl x and answer yes to saving the file. To finish up, regenerate /etc/resolv.conf so the changes are applied right now:
sudo resolvconf -u
Then check the contents of /etc/resolv.conf to see the line you added is now there. Further, it will still be there the next time your machine boots or your network service is restarted, whichever comes first.
Then I did apt-get update and apt-get distupgrade, followed by pihole -r. Then I undid the changes I made to the head file and now everything is back up and running.
Posted Sep 25, 2018, 11:00 PM UTC · edited