Ubuntu/Mint after rebooting Pi-hole doesn't work until I run the command "pihole restartdns"

Fresh install on Mint 18.1, just noticed this morning when I rebooted my laptop.

Thanks!

Make a debug log after rebooting before running the restartdns command.

I believe this was, I can try again but the output looked exactly the same every time I ran it.

The output of the debug command or the debug log? Try another debug log just in case. How did you figure out that Pi-hole wasn't working?

I'll try another one when I get home. I couldn't go to any websites on the laptop where Pi-hole is installed or using any other device so on my Windows computer I used nslookup to verify DNS wasn't working.

Looks like this issue is "dnsmasq" but caused by "networkmanager" as you can see here: https://www.reddit.com/r/pihole/comments/44z1b9/how_to_make_pihole_start_automatically_when_i/czvege9/

OK, so /u/dschaper has looked even further into this... and it appears that UbuntuMate renames the default Ethernet port to something arbitrary (as opposed to something like eth0) which is not set untill networkmanager loads. The issue here is that dnsmasq loads before networkmanager, which means that it's trying to point at an interface that doesn't exist yet.

Is there a way to delay the startup of dnsmasq?

Sorry I keep responding to myself but I found the solution here: 14.04 - dnsmasq starting before eth0 is ready and therefore not binding - Ask Ubuntu

Just add :

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

to the [Unit] section of /lib/systemd/system/dnsmasq.service

Now whenever my laptop running Linux Mint reboots dnsmasq starts correctly!!

1 Like