Finally getting my Pi-hole act together

I have been meaning to do something with the multiple (!) Raspberry Pis I've received over the years, and never got around to it. Until this weekend! Let us take a journey through the Pi-hole project.

The Raspberry Pi

the pi

Chances are if you're reading this blog, you know what a Raspberry Pi is. But perhaps you don't! In which case: it is a small, cheap ($30) barebones computer used by hobbyists for numerous silly ideas. You can plug in the various accessories - monitor, keyboard, mouse - load an operating system, and you have a computer. You can also plug in various sensors, cameras, microphones, and such, and create a wide array of random widgets and doo-dads: robots with computer vision and so on. There are many, many books about this.

The Pi-hole

One popular project is setting up a Raspberry Pi as a network-wide ad blocker. The Pi-hole project makes this very, very easy and friendly. The basic idea is: you route all Internet traffic on your local network through your Raspberry Pi. The Pi-hole software parses a giant blocklist (as well as an optional whitelist) of domains. If the Internet request contains one of those persona non grata domains, it returns a false result - sending it to a DNS sinkhole. In this way, you:

  • Spare a lot of your bandwidth from awful, pervasive ad traffic.
  • For all the devices on your network (computers, phones, TVs, game consoles).
  • And it provides a spiffy web UI for you to monitor (a) who's browsing what, (b) what's getting blocked and let through, and (c) it lets you configure - to a very granular level - which domains are allowed and which aren't.

I have been very, very tempted to use a Pi-hole to sinkhole all social media domains. The Great Firewall of my house!! This has been vetoed, so far, by the other Internet users in my house.

Why not just use an ad-blocker

Since this was the main question I was asked by my other network users. The main reason is: an ad-blocker is device-based. Not even, it's browser-based. So you have to keep installing it on every new browser, on every new device. Pi-hole solves the problem once and for all.

How I set it up

Networking is one of those things I really, really need to learn more about (like Bluetooth!), because otherwise - I swear - my ISP tries to scare me into renting their router or stuff like that. Anyway, so my super basic understanding is that, after setting up your Pi on your network (I wired it via ethernet), you assign it a static IP address and then redirect all traffic to that IP address. Specifically, I followed this tutorial: Quick and Easy Pi-hole Setup 2021.

More Pi-thoughts

If you visit websites like Adafruit and Pimoroni, you'll see lots of fun, inspiring projects. I used to be very intimidated by this stuff, because I couldn't understand how it all came together. The hardware learning curve was (and mostly is) very steep for me, and seemed daunting. Hence why it took me three years to finally getting around to this. Now that I've finally broken that first barrier - turning on the Pi, connecting to it headlessly, and making it my home's Pi-hole - I have the feeling of: "wait, is it always just off-the-shelf stuff?"

Example: the Pimoroni Enviro pHAT, which is a little board that comes with a bunch of weather-related sensors (humidity, temperature, light, noise). You can connect it to your Pi and monitor your indoor ambience. But, reading through the tutorial, it seems to be basically (a) solder this all together, (b) curl the project and bash install it, and (c) voila all your sensors now do stuff! It feels like cheating. It feels so off-the-shelf! Is the only creative contribution I make the way I present the sensor data? That's boring.

Anyway, so my Pi feelings are still in flux. I'm excited by the idea of DOING and MAKING and LEARNING stuff (my favorite things ever, after all). But I'm still scrambling a little at the base of this hardware maker mountain, trying to find projects that are both challenging but achievable (just like when I was trying to learn Python! ah, Zen mind, beginner's mind).


Some further reading and resources


This post is part 1 of the raspberry_pi series:

  1. Setting up the Pi-hole (finally!)
  2. Pi project #2: Indoor environment monitor