Browsing the internet today often means being constantly interrupted by advertisements. These ads can get in the way of reading a news article, watching an episode of a show, or even continuing a game on your phone—they’re simply annoying. Someone who works in tech might think it’s enough to just install an ad blocker like uBlockOrigin or AdBlockPlus. However, it’s surprising to see how many people—even those who browse daily and use a computer for work—see ads as something inevitable, something they just have to live with. That’s the case with some of my family members. And while the easiest thing would be to tell them to use a blocker or install it myself, I decided to look for an even simpler solution for them—one where the technical burden would fall on me.

Among the options I explored, Pi-hole stood out. Essentially, Pi-hole acts as a private DNS server operating on the local network. When a device requests a webpage, it queries Pi-hole instead of a public DNS server. Pi-hole checks whether the address belongs to an ad server and, if it does, blocks the request—preventing the ad from loading. Besides blocking ads, Pi-hole also helps protect user privacy by reducing the amount of data advertisers can collect about browsing habits. As the name suggests, it’s designed to run on a Raspberry Pi, though it can also run on other systems that support certain Linux distributions. To test it, I used a Raspberry Pi 1 Model B+ I had stored away. I installed Raspberry Pi OS and Pi-hole on it. Since June 2023, this Raspberry Pi has been running at home. The only issue is that whenever the home access points are restarted, I need to reconfigure the Raspberry Pi’s IP as the DNS server—but this hasn’t been a major inconvenience.
To improve the setup, I decided to purchase a pair of Raspberry Pi Zero 2 W boards: one to replace the over-10-year-old Raspberry Pi 1 Model B+, and another to add a redundant Pi-hole on the network. This way, I can ensure that all web traffic is filtered through one of the Pi-holes and no ads slip through. Each Raspberry Pi Zero 2 W uses a 32 GB microSD card, which is more than enough for the operating system, the Pi-hole installation, and some future experiments I have in mind.
To install the operating system, I used the Raspberry Pi Imager tool, where I set up the user account and local network credentials. I also added the ssh
file, since I completed the entire setup from the terminal in “headless” mode (i.e., without a screen). I first configured the system using the following command:
sudo raspi-config

I applied the following relevant settings:
- 1 System Options > S5 Boot / Auto Login > B2 Console Autologin
- 1 System Options > S6 Splash Screen > No
- 1 System Options > S7 Power LED > Yes
- 2 Display Settings > D4 Composite Output > No
- 3 Interface Options > I1 SSH > Yes
- 3 Interface Options > I2 RPi Connect > No > No
- 3 Interface Options > I3 VNC > No
- 3 Interface Options > I4 SPI > No
- 3 Interface Options > I5 I2C > No
- 3 Interface Options > I6 Serial Port > No > No
- 3 Interface Options > I7 1-Wire > No
- 3 Interface Options > I8 Remote GPIO > No
Next, I expanded the filesystem to use the full space on the microSD card and rebooted the Raspberry Pi Zero 2 W. Then, I updated all the system components with the command:
sudo apt update && sudo apt upgrade -y
It was also necessary to set a static IP address for the Raspberry Pi Zero 2 W. I did this in two steps: first, I reserved the IP on the router using the Raspberry Pi’s MAC address; then, I disabled DHCP on the Pi and assigned the IP using Network Manager via the terminal:
sudo nmtui

After rebooting to apply the new IP address, I began installing Pi-hole using this command:
curl -sSL https://install.pi-hole.net | bash
The installation includes a wizard that takes a few minutes.

During the setup, I specified that the Raspberry Pi Zero 2 W had a static IP, that it should use Cloudflare (1.1.1.1) as the upstream DNS, and that it should use StevenBlack’s Unified Hosts List for blocking. I also chose to install the web management interface, the required web modules, and to enable logging of all DNS requests.
At the end of the installation, a summary screen appears with the configured IP address, the URL to access the Pi-hole dashboard, and the administrator password.

To change the dashboard password, use the following command:
sudo pihole setpassword
Once everything is set up, you can close the SSH session and manage the Pi-hole entirely from a web browser via the graphical interface.

IIn the Adlists section, you can add blocklists. These contain domains used for ads, tracking, and analytics. For my first installation, I used the recommended lists from The Best Pi-Hole Blocklists (2024) and The Firebog. In this case, I exported the lists from the old Raspberry Pi 1 Model B+ and imported them into the new Raspberry Pi Zero 2 W devices. It’s generally advised not to add all available lists, as some may interfere with the functionality of certain websites—not just blocking ads. After adding the lists, go to the Tools section, select Update Gravity, and click the Update button. This will read the configured blocklists and add the corresponding domains to Pi-hole’s database.
The final step is to log in to your home router and configure the IP addresses of the Raspberry Pi Zero 2 W units as DNS servers. Some routers may not allow you to change DNS settings. If that’s the case, you’ll need to go into your computer’s network settings and manually enter the Raspberry Pi’s IP addresses as DNS servers.

The Raspberry Pi 1 Model B+ came with a case I bought years ago, but for the Raspberry Pi Zero 2 W units, I decided to 3D print two enclosures using the design Raspberry Pi Zero case/Zero W case/Zero 2 W case (2h print) by Nikolica from Printables. Of the two printing options available, I chose the one without supports and let the slicer determine where to place them.


Implementing Pi-hole at home has been an effective solution to block ads and improve my family’s browsing experience, without the need to install ad blockers on each device. It also helps improve privacy and simplifies device use for those who aren’t familiar with ad-blocking tools. This setup enhances security and gives better control over network traffic—making Pi-hole a robust and accessible tool, backed by a large and supportive community.
More information:
Pi-hole
Installation – Pi-hole documentation
pi-hole/pi-hole
Set Static IP Address on Raspberry Pi
pi-hole/PADD
If you have any questions, feel free to comment.