- Type: Personal
- Technologies: Raspberry Pi 3, Raspbian, Bash, OpenSSH
- Length: 1 weekend
I installed pi-hole on a Raspberry Pi 3 and configured my home router to send internet traffic through it to provide network wide ad blocking.
I really hate ads and while blocking ads is fairly easy on a browser, it’s much harder on any other connected device like a smart TV or mobile phone. I heard about the Pi-Hole project from a friend and so I borrowed a Raspberry Pi from one of my roommates to see if we all could benefit from this magical network-wide ad blocking.
This was my first time using a Raspberry Pi and so there was a lot to learn about working with a Pi and Raspbian. I do have experience working with Ubuntu (I converted my college laptop into an Ubuntu laptop because Windows was getting slow) and so the jump wasn’t too big. I more or less followed the exact instructions on their website to get the Pi-Hole installed. Their instructions were very clear and easy to follow. If this is your first time working with a Raspbery Pi, I would recommend this as a great entry-level project.
The next part was actually configuring my router to send traffic through it. I wasn’t quite familiar with DHCP and DNS at the time. I learned that I needed to allocate a static IP address for my Pi so that it wouldn’t keep getting a new IP address. This is important because my network would be using the Pi’s IP address for our DNS server. It was at this point I finally made the connection as to how the Pi-Hole worked: actively filtering out the DNS queries that devices on our hone network were making. The Pi-Hole acts as a “man-in-the-middle” to stop queries that were reaching out to ad-serving domains.
As promised, sites that serve tons of ads (think recipe sites) were suddenly much cleaner and loaded faster since they didn’t load the ads anymore. When I browsed Reddit on my phone, the little banner didn’t have ads in them anymore. However, the solution isn’t foolproof as no list of ad-serving domains is fully complete. I still use uBlock Origin in my browser to catch any ads that fall through the cracks. Additionally, there are times when legitimate sites get blocked by the Pi-Hole and I needed to manually need to let them through. This was especially a problem because I shared an internet connection with three other roommates. Finally, if you play online video games, I’m pretty sure that I didn’t notice any extra lag with the Pi-Hole on our network.