Where did all the ads go?

If you are like me and run your own IT department at home then a simple to use service that I highly recommend is Pi-hole.

Pi-hole is a DNS server that you run localy in your network. You setup your DHCP settings to use it as your primary DNS server instead of your ISP’s DNS server or perhaps something else you set up, like Google’s or servers.

The Pi-hole service itself will use your ISP, Google or OpenDNS server to figure out anything it does not know, but for a laundry list of ad sites it will respond basically with ‘Go Away’. In a nice way.

The end result is that when you open an ad infested web page, or if you run pretty much any app downloaded from the Apple or Google Stores, open the Smart App on your TV or watch ad-laden videos on Youtube, many of the ad requests are intercepted by Pi-hole and are replaced with something benign that doesn’t interrupt your viewing and also does not report back all kinds of data about what you are doing……… Hence not only is it an ad blocker for your network, but it is also a privacy guard against reporting data under the hood that you might not be aware of.

Straight out of the box it can be configured to use a number of popular block lists. As you search around the Internet you might encounter more lists that you would like to use, so adding them is pretty straight forward. In addition you will see over time that Pi-hole logs information about additional reporting sites that might not be blocked, such as Samsung’s TV usage reporting site. Simply click on the Blacklist button and reporting your useage to that site will stop.

Also if you have people at home who still insist on visiting a few ad-related sites that might be blocked in one of the lists you are using, such as some online clothing shop that your wife wishes to access, you can either permanently white-list it or you can suspend Pi-hole for the next few minutes, both allowing someone to access the site in question.

All in all it is pretty easy to setup. However I ran into a few hiccups getting it running. For example, Pi-hole uses dnsmasq under the hood for its DNS resolver. If you are already using dnsmasq and you install Pi-hole on the same box, when Pi-hole updates the dnsmasq configuration files the installation will likely stop at that point and fail. Why? The default dnsmasq still does not know about your tweaks and changes - such as the address of your ISP’s DNS server, or if you use a local hosts file, etc. To avoid this, take all of your changes and extract them out of the default dnsmasq.conf file and create your own /etc/dnsmasq.d/05-mystuff.conf file. The installation might still blow up due to duplicate settings in your file and the Pi-hole file, but those will be easier to sort out as you rerun the installation and edit your config file.

So if you are comfortable running your own mini-IT department at home and setting up a Linux server to run Pi-hole is something you can do in your sleep, then it is worth considering using Pi-hole. You could do all this manually with dnsmasq itself (I used to do that), but Pi-hole has a pretty UI and it can update stuff on its own. Yay.