Ubuntu after restart: DNS Service not started

Getting this after pihole status and in the web page
DNS service NOT running

Update: If I run pihole -r repair it will run again but after the next reboot it will be broken again.

This is Ubuntu 16.04 LTS on an Intel NUC, new install. I've put in some other utilities like OpenVPN but nothing that should be interacting with dsnmasq that I know of. Prior to this I put PiHole on three other Raspberry Pi3 and worked great so I've used it before (and donated). Still using one as my secondary DNS for this network if this has trouble, which seems it is.

---=== Your debug token is : 0fah9bqn87 Please make a note of it. ===---

sudo dnsmasq --test
dnsmasq: syntax check OK.

systemctl -i status dnsmasq
● dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled; vendor preset: 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 2017-10-22 10:47:30 EDT; 27min ago
Process: 1142 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=2)
Process: 1095 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUCCESS)

Oct 22 10:47:30 ubuntuserver systemd[1]: Starting dnsmasq - A lightweight DHCP and caching DNS server...
Oct 22 10:47:30 ubuntuserver dnsmasq[1095]: dnsmasq: syntax check OK.
Oct 22 10:47:30 ubuntuserver dnsmasq[1142]: dnsmasq: unknown interface enp3s0
Oct 22 10:47:30 ubuntuserver systemd[1]: dnsmasq.service: Control process exited, code=exited status=2
Oct 22 10:47:30 ubuntuserver systemd[1]: Failed to start dnsmasq - A lightweight DHCP and caching DNS server.
Oct 22 10:47:30 ubuntuserver systemd[1]: dnsmasq.service: Unit entered failed state.
Oct 22 10:47:30 ubuntuserver systemd[1]: dnsmasq.service: Failed with result 'exit-code'.

ifconfig
enp3s0 Link encap:Ethernet HWaddr f4:4d:30:xx:xx:xx
inet addr:10.0.1.6 Bcast:10.0.1.255 Mask:255.255.255.0
inet6 addr: fe80::f64d:30ff:fe64:d48c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4606446 errors:0 dropped:0 overruns:0 frame:0
TX packets:2017147 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:6718285636 (6.7 GB) TX bytes:2048308968 (2.0 GB)

tail -f /var/log/pihole.log
Oct 22 10:45:52 dnsmasq[31815]: query[A] api.segment.io from 10.0.1.138
Oct 22 10:45:52 dnsmasq[31815]: /etc/pihole/gravity.list api.segment.io is 10.0.1.6
Oct 22 10:46:10 dnsmasq[31815]: query[AAAA] 1.ubnt.pool.ntp.org from 10.0.1.5
Oct 22 10:46:10 dnsmasq[31815]: cached 1.ubnt.pool.ntp.org is NODATA-IPv6
Oct 22 10:46:40 dnsmasq[31815]: query[A] ssl.google-analytics.com from 10.0.1.57
Oct 22 10:46:40 dnsmasq[31815]: /etc/pihole/gravity.list ssl.google-analytics.com is 10.0.1.6
Oct 22 10:46:46 dnsmasq[31815]: query[SOA] local from 10.0.1.6
Oct 22 10:46:46 dnsmasq[31815]: forwarded local to 208.67.222.222
Oct 22 10:46:46 dnsmasq[31815]: forwarded local to 8.8.4.4
Oct 22 10:46:46 dnsmasq[31815]: exiting on receipt of SIGTERM

Have a read here about those predictable network interface names:

EDIT: I noticed on latest Raspbian, you can enable/disable this feature with the "raspi-config" tool under "Advanced Options".

I will look at this closer tonight but what I'm seeing in the logs is highlighted above, it can't find enp3s0 which I told it to look for in pihole setup and I do have enp3s0 according to ifconfig.

First off, very important note, this is not raspbian. This is regular Ubuntu 16.04 LTS running on an Intel NUC.

After reading some of the things you linked I changed the USB net by mac rules which didn't work. BUT if you read the notes at the top of the page that only applies to network adapters over USB which is NOT what I have.

So at the moment PiHole works for me if I repair the install after rebooting but it will break with each reboot so something is breaking / setting not being retained somewhere.

Minor update but it still breaks after each reboot.

Certain Ubuntu versions have a broken dnsmasq package which does not start the service after the network has been initialized.

1 Like

Experiencing same problem here. dnsmasq.service doesn't start properly on reboot. If started manually after reboot, runs fine. Problem seems to be that it won't start before network adapter is in a ready state.

Edited to add: Web interface starts, and pihole can be enabled from the web interface. Problem is limited to dnsmasq package failing to start at boot. Ubuntu server 16.04

1 Like

Is this possibly something that will be fixed soon or do we need to take action?

It's a problem with the dnsmasq package, not Pi-hole.

Please correct me if I am wrong. Some programs need eth0 for compatibility.

Understood, but will Ubuntu fix this or is it intended behavior?

I don't know if they will or have fixed it; I'm not a Ubuntu dev.

Update; confirming this is Ubuntu's problem.

Add the follow two lines in the [Unit] section of /lib/systemd/system/dnsmasq.service

After=network-online.target
Wants=network-online.target

and

and finally they are still in process of fixing it apparantly

.