The Internet seems to run on advertising – and that is fair. Companies and individuals need to find a way to monetize their products and data without hiding everything behind paywalls. With that being said, there are plenty of sites and services with ill intent when it comes to harvesting data, counting clicks, analyzing and attributing browsing habits, etc. As a consumer, a daily user of the Internet, and one who actually relies on the Internet for my livelihood, I feel it is very important to protect myself and my family’s online activities.
What is Pi-hole? It is an application that runs on Linux (which could be running on a Raspberry Pi) that acts as a DNS sinkhole. When traffic from your network is looking to route to an unwanted domain on the Interwebs, Pi-hole simply refuses to respond with an IP address of the destination. This is a pretty slick way to head off adware and other dynamic content that gets rendered in a lot of sites. For me, I absolutely despise when I browse to a site, start reading and then the whole page rearranges/shifts because an ad pops.
I was surprised at how easy this was to set up. First, a key point: Pi-hole does NOT require that you purchase a(nother) Raspberry Pi – it can run in a few different ways. First, it can run as a Docker container (awesome) or you can simply install it on the various operating systems that are supported. I have a beefy (if old) Hyper-V server running in my basement, so, for my purposes, I chose Ubuntu 18.04 – mostly because I already have a VM image created. I fired up a new copy of the image, sudo update && sudo upgrade and then away we go.
I read through the install and chose to install this with the One-Step Automated Install. It is a VM – if something goes wrong, I can revert to a new image since nothing else is happening on this machine anyway. The One-Step install went almost perfectly. It was fast and I only hit one minor snag post install – DNS resolution on the machine was pointed to 127.0.0.53 in the /etc/resolv.conf file. I changed the file so that DNS is now resolved via my router (forwarded to ISP).
The next step was to set the Pi-hole admin password. From my reading it sounds like I might have missed a password getting set during the install and being displayed the screen. No biggie, the password can be set by a machine admin:
The last step to configure Pi-hole was to update Gravity. I am not 100% sure this is a required step in order to get the Pi-hole working initially, however, things started working almost instantly (and awesomely) immediately after I ran the update. Basically, Gravity takes all your block lists, consolidates them, and then that’s the list that is then used to sink unwanted requests:
The only thing left to do at this point is to change the DNS settings in my environment so that my machines all start using the Pi-hole for DNS. For me, this actually meant temporarily cutting over to the built in DHCP server that the Pi-hole provides for the purposes of this blog post.
Note – disable any other DHCP services running on the network.
24 hours later
Wow, what a difference.
Sites that are riddled with ads and out of control JS that cause me to want to hulk smash the keyboard because the content moves after I have started reading…are no longer misbehaving. Games on my cell phone…playable! What a massive improvement in the user experience. And I now have the ability to pull in additional lists or purposefully block sites and services in my environment by simply adding them to the list. I already love it, and this is going to be a very handy tool to have for testing purposes.