Easily Build a Network-Wide Ads Blocker with Raspberry Pi

If you’re like me, tired of all the ads that are bombarded at you when you are browsing the web, then you came to the right place. I present to you a simple guide that you can follow to build a network-wide ads blocker with a Raspberry Pi. After you set up and configure this device, you will have control over your home network to a far greater degree.

Shopping List

First, you must purchase a Raspberry Pi or re-purpose one you may already own. I provide you with a link to the kit that I bought. The kit includes everything you need to get up and running with a Raspberry Pi from a well respected Pi distributor. Otherwise, you’re free to buy everything separately.

I also recommend buying a CAT-6 ethernet cable to connect your Pi to your router for the fastest data exchange between the Pi and your router.

Setup Your New Raspberry Pi

When you have your Raspberry Pi, you will need to install the operating system onto the micro-SD card. Here is the link to the official download page. Download the imager that is appropriate for your operating system. Then plug the SD card into your computer and use the imager to install the Raspbian OS onto it.

Next, put the SD card into the Pi SD card slot, attach the HDMI cable to your monitor, attach your USB keyboard and mouse and plug in the AC power adapter. Follow the onscreen prompts that display to your monitor to set up the password for the user and configure wifi. After the initial configuration, restart the Pi.

For a headless Pi (no monitor), I recommend enabling the Virtual Network Computing setting and SSH. Select Menu > Preferences > Raspberry Pi Configuration > Interfaces, then enable VNC and SSH. Then, download Real VNC software for your operating system here. This allows you to remotely access your Pi through your computer, providing you with the GUI of your Pi.

Install Pi-Hole

To block ads and monitor network metrics, we use the open-source Pi-Hole software. To get started quickly, enter the command below in the Raspberry Pi terminal.

curl -sSL https://install.pi-hole.net | bash

Configure Your Router

After Pi-Hole is installed, you must configure your router to use Pi-Hole as the DNS server. There exist three ways to configure your router to use Pi-Hole as the DNS which are described here. The method you choose will likely be determined by your router software. Regardless of the method, each requires the IP address of your Pi. Enter the command below into the terminal to learn your Pi’s IP address.


Optional: Use Pi-Hole as DHCP Server

It’s beneficial to set up the Pi-Hole as the DHCP server. This allows the Pi-Hole to hand out IP addresses to your devices. Additionally, this setting allows the Pi-Hole webapp to display the hostname of each device rather than the ip address in query logs.

View the Pi-Hole Web App

Finally, you can enter the Pi-Hole web app by typing the command below into your web browser. Replace the IP portion of the command with the IP address of your Raspberry Pi.



In this guide, I explained how easy it is to build a network-wide ads blocker with Raspberry Pi. I hope this improves your home network as it did mine.

For another related project, let me recommend you A Short and Sweet Solution to Extend Your WiFi Coverage Area Throughout Your Home Easily

0 0 vote
Article Rating
Notify of
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x