Dnsmasq failing to start (v2.76) and Pi-Hole 3.3.1

Cannot get dnsmasq to start. Troubleshooting steps I have already tried related to Option 2 of 3.3 do not match the criteria of issues reported there. I am running dnsmasq 2.76.

https://pi-hole.net/2018/02/14/pi-hole-v3-3-released-its-extra-special/

Expected Behaviour:

pihole running with dnsmasq running

Actual Behaviour:

dnsmasq is in a failed state and cannot be started.

pi@raspberrypi:~ $ dnsmasq -v
Dnsmasq version 2.76 Copyright (c) 2000-2016 Simon Kelley

pi@raspberrypi:~ $ pihole -v
Pi-hole version is v3.3.1 (Latest: v3.3.1)
AdminLTE version is v3.3 (Latest: v3.3)
FTL version is v3.0 (Latest: v3.0)

pi@raspberrypi:~ $ 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: exit-code) since Sun 2018-07-15 13:06:08 EDT; 8min ago
Process: 31302 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=1/FAILURE)
Process: 31299 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUCCESS)

pi@raspberrypi:~ $ cat /etc/*release
PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"

Debug Token:

[✓] Your debug token is: oq7kzwpttl

What is the output of sudo service pihole-FTL status -l

pi@raspberrypi:~ $ service pihole-FTL status -l
● pihole-FTL.service - LSB: pihole-FTL daemon
Loaded: loaded (/etc/init.d/pihole-FTL)
Active: active (exited) since Sat 2018-07-14 15:14:19 EDT; 1 day 7h ago
Process: 556 ExecStart=/etc/init.d/pihole-FTL start (code=exited, status=0/SUCCESS)

And how about the output from sudo systemctl status --full --no-pager dnsmasq.service? Trying to get the actual command that caused it to exit.

Hi,

I had I think a similar problem. So before I create a new thread, I’ll add another data point.

I had to apply 2 fixes one to fix systemd/resolver interference and the other to to kick dnsmasq into using Wlan0

Resolver fix:

fix for dnsmasq not starting

#From : Dnsmasq not starting - Ubuntu 18.04 - #12 by RamSet

DNSStubHandler=no
DNSStubHandler=no

wlan0 fix:

/etc/dnsmasq.d/01-pihole.conf

Adding:

bind-dynamic # from dnsmasq: wlan0 not found - Raspberry Pi Forums

TL;DR For details below.

Please note I am not trying to hi-jack this thread.

I am not sure what triggered this problem.... things have been running fine on this Pi-hole... the only other thing I have done was installed retropie (a couple of weeks ago)...

My debug token is: 2xwkweenvz

I hope this helps you if not I will create a new thread... maybe this helps someone else ....

Frank

——————— snip snip —————————

fix part 1 was required to:

/etc/dnsmasq.d/01-pihole.conf

Adding:

bind-dynamic # from dnsmasq: wlan0 not found - Raspberry Pi Forums

This was fix dnsmasq not starting because address in use.

Fix part 2:

My problem was that dnsmasq stopping using wlan0...

The clue was:

root@tompie:/var/log# grep wlan pi*
grep: pihole: Is a directory
pihole_debug.log:[✓] IPv4 address(es) bound to the wlan0 interface:
pihole_debug.log:[✓] IPv6 address(es) bound to the wlan0 interface:
pihole_debug.log: PIHOLE_INTERFACE=wlan0
pihole_debug.log: interface=wlan0
pihole_debug.log: Jul 16 22:19:51 dnsmasq[531]:
pihole.log:Jul 16 22:19:51 dnsmasq[531]: warning: interface wlan0 does not currently exist
pihole.log.1:Jul 7 12:24:24 dnsmasq[475]: warning: interface wlan0 does not currently exist
pihole.log.1:Jul 7 16:55:38 dnsmasq[532]: warning: ...
....
interface wlan0 does not currently exist
pihole.log.1:Jul 7 20:02:16 dnsmasq[527]: warning: interface wlan0 does not currently exist

Just got a chance to grab the output. Here it is:

pi@raspberrypi:~ $ sudo systemctl status --full --no-pager 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: exit-code) since Sun 2018-07-15 23:06:46 EDT; 24h ago
Process: 10390 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=1/FAILURE)
Process: 10387 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUCCESS)

Jul 15 23:06:46 raspberrypi dnsmasq[10387]: dnsmasq: syntax check OK.
Jul 15 23:06:46 raspberrypi dnsmasq[10390]: dnsmasq: junk found in command line
Jul 15 23:06:46 raspberrypi systemd[1]: dnsmasq.service: control process exited, code=exited
status=1
Jul 15 23:06:46 raspberrypi systemd[1]: Failed to start dnsmasq - A lightweight DHCP and cach
ing DNS server.
Jul 15 23:06:46 raspberrypi systemd[1]: Unit dnsmasq.service entered failed state.

Pihole still not working and I'm not sure why. Junk found in command line seems to be the error?

Hmmm.. I'm not sure if we experienced the same thing. For one I'm not using wireless interface on my rpi. And also I don't think my router assigned the same address for the Ethernet and wireless adapter if that's what you are suggesting. I might've misunderstood what you were stating.

I had the same problem as Zack. It happened right after updating my pi with apt-get upgrade & update to the latest versions.

In /etc/init.d/dnsmasq the variable DNSMASQ_OPTS is filled with values based on the contents of "/usr/share/dns/root.ds", but the sed statement that tries to do so expects another format then root.ds actually seems to have: There's now a number between the initial . and the "IN DS" part. Also the field seperators are now partly tabs instead of spaces.

A quick fix would be to replace the first sed part
s/". IN DS "/--trust-anchor=.,/
with
s/".*\t"/--trust-anchor=.,/

That fixed it for me :slight_smile: But I'm sure it can be done better.

1 Like

Yes, the 'junk found in command line' is a known bug with the dnsmasq package from Raspbian/Debian. The short term solution until they update their packages with the proper functionality is to either remove the dns-root-data package that introduced the extra characters, or modify the /etc/init.d/dnsmasq file from:

ROOT_DS="/usr/share/dns/root.ds"

if [ -f $ROOT_DS ]; then
   DNSMASQ_OPTS="$DNSMASQ_OPTS `sed -e s/". IN DS "/--trust-anchor=.,/ -e s/" "/,/g $ROOT_DS | tr '\n' ' '`" 
fi

to:

ROOT_DS="/usr/share/dns/root.ds"

if [ -f $ROOT_DS ]; then
   DNSMASQ_OPTS="$DNSMASQ_OPTS `sed -e s/".*IN[[:space:]]DS[[:space:]]"/--trust-anchor=.,/ -e s/"[[:space:]]"/,/g $ROOT_DS | tr '\n' ' '`" 
fi
1 Like

Hi,

Agreed, different issues.

Maybe related due to underlying Raspbian changes?

I wonder if using ftldns would haves avoided some of these problems?

Frank

Dan, thanks for this - got my pihole working again.

1 Like

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