Dnsmasq not starting since last week!

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.

Ran that without any issues, but the the status of dnsmasq is still failed. Here's my debug token: du4vq3gstt

What did that command output (the dnsmasq one)?

Nothing, it went right to the prompt.

For clarification, does that mean it does not output anything but runs (may appear as it would hang) or does it mean that it exited immediately without printing anything?

If you want to use a port below 1024 this forces you to run all network daemons with superuser privileges, which might open security holes. Hence, this security model is obsolete IMHO and today it only gives a false sense of security and contributes to security holes.

TL;DR You have to run dnsmasq as root.

Sorry for a late reply, the command exited immediately without any output.

Okay, so your dnsmasq is immediately exiting without printing an error. This is very weird but maybe you can find a similar issue using e.g. Google?

Maybe the binary got damaged, you could try

sudo apt-get install --reinstall dnsmasq

Just wanted to update you guys on this. I ended up installing Raspbian Stretch on my RPi & the installed pihole. It's working fine now.

1 Like

You inadvertently stumbled on to the solution by installing stretch, since the fix is in dnsmasq 2.76.
The actual problem is detailed below, along with a fix for jessie.

The solution I first discovered here:
https://www.raspberrypi.org/forums/viewtopic.php?t=128449#p919942

Then found the bug ticket here:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=860064

The diff patch to fix is here:
https://bugs.debian.org/cgi-bin/bugreport.cgi?att=3;bug=858506;filename=dnsmasq-init.patch;msg=27

You can install a more recent version of DNSMASQ here:

1 Like