Pi-hole – Dnsmasq Not Starting Automatically (Ubuntu 16.04)

Pi-hole is a DNS sinkhole designed to block ads at the network level by acting as your DNS server; it’s like using AdBlock for every device on your network. It’s especially useful for iOS and Android devices since Pi-hole can block ads in both the browser and apps.

Installation on my Ubuntu 16.04 box was dead simple:

After running it for almost a week, I accumulated the following stats below; it’s amazing how many requests were blocked since I’m already using uBlock in Chrome.

After rebooting the system Pi-hole was running on, I noticed the DNS resolution was broken because the dnsmasq service was not running:

Apparently there is a bug in Ubuntu 16.04 with the dnsmasq service trying to start before network interface is up. Thanks to this, I was able to fix it by adding the highlighted lines below to the [Unit] section of /lib/systemd/system/dnsmasq.service: