It’s no secret that online advertising can sometimes disrupt your web browsing experience. Even on mobile, banner ads, pop-ups and other unwanted confusions are impossible to avoid. Phone and TV makers have also started hiding ads on Android skins and interfaces. Fortunately, there’s an easy way to block ads across your entire Wi-Fi or home network, with cheap hardware like Raspberry Pi Zero ($ 10) and a free software called Pi-Hole. Follow along to learn how.
Read more: All you need to know about raspberry pie
Quick summary
To block ads on your entire home network, all you need is a DNS filter like Pi-Hole running on a low-power computer like Raspberry Pi. Then, configure your router to send all future DNS queries to the pie-hole computer instead of the default setting.
Jump to the main section
Introduction: How does it work?
You’re probably already familiar with browser-based extensions that allow you to block ads from websites. However, this is not always an effective strategy – most web browsers for Android and iOS, including Chrome, do not support extensions. The same thing applies with smart televisions, game consoles and other non-browser apps. Fortunately, you can block ads across your entire network using a DNS-level filter or synchole.
DNS stands for Domain Name Resolution. It converts human-readable domain names (such as www.google.com) into an IP address that computers can recognize. By default, your router forwards all DNS queries to your internet provider’s server.
However, we can route all DNS requests to a different destination – such as the ad-blocking filter we will install in this guide. Then, whenever a device on your network tries to communicate with an ad-related domain, our custom DNS server will block it. Other non-advertising domains, meanwhile, will continue to pass through an upstream DNS server, such as Google or Cloudflare.
The advantages of this method are obvious: you do not have to install ad-blocking software on every device in your household. Moreover, it only needs to be set up once. DNS filtering is also highly resource-efficient because the process takes place on a separate, dedicated device and within your home network. If all this sounds good to you, here’s how to install a raspberry pie pie-hole.
Collect hardware and install Raspberry Pi OS
For this guide, you will need a computer that you can use throughout the day. Since DNS queries are extremely light, the Raspberry Pi family is the perfect choice for this purpose. These devices consume very little power and you can even get away with the low-end Raspberry Pi Zero W ($ 10) or the older full-size Pi 3 ($ 25-35). You can reuse an old laptop or desktop for this purpose – just make sure you don’t pick out the strong, energy-hungry parts. You will also need to install a Linux distribution.
In addition to a raspberry pie, you’ll need a power adapter (a smartphone charger will probably work) and a microSD card (8GB or higher) to serve as your boot drive.
Once your hardware is ready, it’s time to install an operating system on a microSD card. Start by inspecting This link Download the Raspberry Pi Imager tool on a desktop computer or laptop. Then, insert the microSD card into your computer.
After that, install and open the tool. Select Raspberry Pi OS (Raspberry) As your operating system, and microSD card from the drive list.
Calvin Wankhede / Android Authority
Press Ctrl + Shift + X. Simultaneously bring up the Advanced Settings menu (pictured below). Click Enable SSH And enter a password. If you want to use a wireless connection to Pi, you must also enter your Wi-Fi credentials here.
Calvin Wankhede / Android Authority
Close and press the Advanced Settings menu Write Button Accept the warning and move on. At this point, the tool will automatically download a copy of Raspberry Pi OS and write it to your microSD card.
Calvin Wankhede / Android Authority
Once complete, pull the microSD card from the computer and insert it into the pie. Turn on the board and wait for it to boot – this may take a few minutes. If you haven’t provided your Wi-Fi details before, be sure to connect the Pi to your router via an Ethernet cable.
Install the pie-hole in the raspberry pie
Once Raspberry Pi is up and running, all we need to do now is install the pi-hole and configure your router to redirect DNS queries to it instead. Before that though, we need to find out Pi’s IP address on our local network. An easy way to do this is like a network scanning app Caught. In my case, the IP address was 192.168.0.107 (pictured below), but it might look completely different for you.
Calvin Wankhede / Android Authority
With that, we now have enough information to connect to Raspberry Pi remotely. Remember the SSH setting we introduced in the previous section? This will allow us to run the command in Pi from a different computer or smartphone. For this tutorial, we will use Putty In Windows, however, the general steps are the same even if you use a different SSH client Termias On Android or iOS.
How to install pie-hole in raspberry pie:
Open the SSH client of your choice, enter your Raspberry Pi IP address from the previous step and click Connect Or Open.
Calvin Wankhede / Android Authority
Accept the security prompt, if one is present.
Calvin Wankhede / Android Authority
When prompted to login, enter Pie For username. Finally, use the password you set in the previous section.
Calvin Wankhede / Android Authority
We can now install the pie-hole. Just copy the following command and paste it into the SSH client. Then, press Enter to run it.
curl -sSL https://install.pi-hole.net | bash
Calvin Wankhede / Android Authority
Finally, you will be presented with a one-time setup process for Pi-Hole. Follow the on-screen instructions – you can use the default settings everywhere.
Finally, you will be greeted with an Installation Summary screen. Here, make a note of yours IPv4 address – We will configure our router to be used in the next section.
Calvin Wankhede / Android Authority
If you want to manage your Pi-hole later, be sure to enter the web interface address and password as well.
Calvin Wankhede / Android Authority
You can now close the SSH session.
Configure your router to use Pi-Hole
Dhruv Bhutani / Android Authority
At this point, you should have a successful pie-hole installation from the previous sections. In this final section, we will configure our router to send all future DNS queries to pi-holes. This can be a bit complicated, as the exact steps vary depending on the brand and model of your router. However, most major brands have support pages on how to configure DNS settings, such as This is it Or for TP-Link This page From Netgear.
Calvin Wankhede / Android Authority
As you can see in the screenshot above, change the DNS server entries from your router to the IP address of our Pi. This will ensure that all queries are sent to our pi-holes, which will filter out ad-related domains for us.
While we’re at it, you should set a static IP for your Raspberry Pi. This will ensure that the router does not assign your Pi’s current IP address to another device. If so, your DNS queries will fail and it will appear that you have no internet connection Again, consult your router manufacturer’s help pages for step-by-step instructions, such as This page From Netgear.
If for some reason you can’t access your router’s admin panel, you can manually change the DNS settings on each device. Again, this may vary depending on the operating system and version of your device. In Windows 11, you’ll find it below Settings > Network and Internet > WiFi > Manage familiar networks > Your home network. Change both DNS entries to your Pi’s IP address as shown in the screenshot below.
Calvin Wankhede / Android Authority
To change the default DNS server on your Android device, log in Settings > Network and Internet > WiFi. Then, long-term, tap the network name Change the network, And Show more options. Finally, change the IP settings Fixed And enter the IP address from the previous one.
Does Pi-Hole block all ads?
Pi-Hole refers to a database of domains known to block ad-related websites at the DNS level. On the other hand, ad-blocking extensions manually filter ad-related code after you load a webpage. Both methods work well, but extensions may work better in some complex situations, such as YouTube advertising.