Dnsmasq not starting since last week!

Please follow the below template, it will help us to help you!

Expected Behaviour:

PiHole should be running and resolving DNS for the network

Actual Behaviour:

No DNS resolution or web interface for PiHole. I had to add 8.8.8.8 to the router to resolve DNS

Debug Token:

PiHole could not upload the log file, got this error: There was an error uploading your debug log. * Please try again or contact the Pi-hole team for assistance.

  • A local copy of the debug log can be found at: /var/log/pihole_debug-sanitized.log
    Let me know where I can upload the logfile. I tried uploading it to tricorder.pi-hole.net, but got a 403 Permission denied error.

If it can connect to the outside world, then try cat /var/log/pihole_debug.log | pihole tricorder

Otherwise, you'll have to manually upload it to a pastebin site and link it here.

I am currently away from my RPi, but I have the logs uploaded to pastebin, here's the link: https://pastebin.com/sFGY9eMQ

What is the output of:

sudo service dnsmasq status

And what happens if you try to start it?

sudo service dnsmasq start

sudo service dnsmasq status:
● dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled)
Drop-In: /run/systemd/generator/dnsmasq.service.d
└─50-dnsmasq-$named.conf, 50-insserv.conf-$named.conf
Active: failed (Result: signal) since Sun 2017-12-17 19:56:48 EST; 1 day 1h ago
Process: 3509 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=killed, signal=SEGV)
Process: 3506 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUCCESS)

Dec 17 19:56:48 raspberrypi dnsmasq[3506]: dnsmasq: syntax check OK.
Dec 17 19:56:48 raspberrypi systemd[1]: dnsmasq.service: control process exited, code=killed status=11
Dec 17 19:56:48 raspberrypi systemd[1]: Failed to start dnsmasq - A lightweight DHCP and caching DNS server.
Dec 17 19:56:48 raspberrypi systemd[1]: Unit dnsmasq.service entered failed state.

sudo service dnsmasq start
Job for dnsmasq.service failed. See 'systemctl status dnsmasq.service' and 'journalctl -xn' for details.
$ systemctl status dnsmasq.service
● dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled)
Drop-In: /run/systemd/generator/dnsmasq.service.d
└─50-dnsmasq-$named.conf, 50-insserv.conf-$named.conf
Active: failed (Result: signal) since Mon 2017-12-18 21:03:31 EST; 50s ago
Process: 13058 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=killed, signal=SEGV)
Process: 13055 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUCCESS)

What are the contents of /var/log/pihole.log now?

It's an empty file, nothing in it.

It looks like you're on v3.1.4, have you tried updating to v3.2? You probably will have to change /etc/resolv.conf to use a different DNS server to access the internet to do the update though.

Thanks Mcat, but my pihole is already at 3.2.
image

We just released a bugfix release, v3.2.1. Try updating to that. If it still doesn't work, run pihole -d for a new debug token.

Hi Mcat, just updated PiHole and unfortunately still stuck with the dnsmasq issue. Here is the journalctl -xn result after restarting dnsmasq service:

-- Logs begin at Sun 2017-12-24 09:04:10 EST, end at Sun 2017-12-24 09:13:46 EST. --
Dec 24 09:13:23 raspberrypi systemd[1]: Starting dnsmasq - A lightweight DHCP and caching DNS server...
-- Subject: Unit dnsmasq.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit dnsmasq.service has begun starting up.
Dec 24 09:13:23 raspberrypi dnsmasq[2392]: dnsmasq: syntax check OK.
Dec 24 09:13:23 raspberrypi systemd[1]: dnsmasq.service: control process exited, code=killed status=11
Dec 24 09:13:23 raspberrypi systemd[1]: Failed to start dnsmasq - A lightweight DHCP and caching DNS server.
-- Subject: Unit dnsmasq.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit dnsmasq.service has failed.
--
-- The result is failed.
Dec 24 09:13:23 raspberrypi systemd[1]: Dependency failed for Host and Network Name Lookups.
-- Subject: Unit nss-lookup.target has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit nss-lookup.target has failed.
--
-- The result is dependency.
Dec 24 09:13:23 raspberrypi systemd[1]: Unit dnsmasq.service entered failed state.

I have already run apt-get update & upgrade and there's no updates.Anything else that I can try?

Thanks!

It looks like dnsmasq is failing via segmentation fault without opening the log:

Process: 13058 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=killed, signal=SEGV)

Do you have any config files in /etc/dnsmasq.d? Try running pihole -g and share the output.

I only have 01-pihole.conf and README files in that folder. and running pihole -g gives me 3 red Xs for DNS service.

Dnsmasq sounds like it's failing early before it can write to the log. What is the output of this command?

sudo -u dnsmasq dnsmasq -d -k

That gives me the following error:

pi@raspberrypi:~ $ sudo -u dnsmasq dnsmasq -d -k
dnsmasq: failed to create listening socket for port 53: Permission denied

Just checked with netstat -an, there is nothing listening on that port on the pi.

Thanks!

Try sudo dnsmasq -d -k

Just to chip in mine has also "stopped working" but only in appearance.

Capture

It seems Dnsmasq keeps failing to load in the web GUI even if you try to re-load it;
pihole status
[✗] DNS service is NOT running

However if I run the following;
pihole -g
[✓] Force-reloading DNS service
[✓] DNS service is running
[✓] Pi-hole blocking is Enabled

Maybe it's something screwy with the web GUI? what's even stranger is that when Dnsmasq is "Off" I can still browse the Internet fine despite Pihole being my sole DHCP/DNS server.

Run pihole -d for a debug token.

Debug token - y525nayxz0

Not sure about your issue. Make a new thread and you'll probably get some more people to look at it.