Shut your damn Pi-hole

At some point in your life, you might have heard about a device called a Raspberry Pi.  It’s a relatively small SoC (System on a Chip) that’s an entire computer.  Processor, memory, network interface, the whole shebang.  Well there’s a project out there called Pi-hole, which is a piece of software that you run on said Raspberry Pi.  What it does is something pretty awesome – it turns your Pi into a hardware-based, network-wide ad blocker.

Yep.  This shit is bonkers.  Now, on Raspberry Pis, the OS they run is called Raspbian, which is just a specialized distro of Debian Linux.  And ya know what that means – Pi-hole can be ran in a VM running a Debian-based distro.  After I did some research, I took the plunge, fired up a CentOS VM, and installed it with a single command:

curl -sSL | bash

That’s it.

Configuration-wise it’s pretty simple.  Usually when your computer queries a websites DNS information, it does so to your router.  With a Pi-hole in place, you modify your DHCP information to provide the Pi-hole’s IP as your network’s DNS server.  The Pi-hole then, in turn, forwards requests to your router as expected.

All your clients ask the Pi-hole for website IPs, and if it doesn’t have them, it asks your router.

Now from here, the Pi-hole has a list of blacklisted IPs.  If you load a website and any of those sites have an embedded ad that matches one of those blacklisted IPs?  It returns nothing to your browser and doesn’t even load the ad itself.  It’s really quite beautiful.

The absolutely awesome part of this solution running network-wide is that it blankets every single one of your devices.  Your phone, your PC, your Xbox, TV, Roku, anything.  No need for plugins or any of that jazz anymore, and because it doesn’t even load the ad, your network’s bandwidth use is potentially less.

Another plus is it actually blocks YouTube ads from playing.  I was watching some shit on YouTube through my Roku yesterday, and it would spin for a second like it was trying to load an ad, then just cut straight to the video I wanted.  It’s pretty slick.

And if you’re the type that likes to see logs and statistics – there’s a GUI that shows what the Pi-hole has been doing.  Logs for blocked and allowed connections.  Graphs showing forwarded and cached DNS requests.  It’s fantastic, and the ability to run on a relatively slim VM (1 vCPU, 1 GB RAM, 16 GB HDD), how can you beat that kind of functionality?

Link to the good stuff.