While there are many ad-blockers that can remove ads from your computer, they rarely work on other devices, such as smartphones or tablets.
This article will show you how to convert a Raspberry Pi into an ad blocker all over the network, using Pi-Hole. Once completed, you will be able to block ads on laptops, computers, smartphones, tablets and any other devices connected to the network.
Block ads for the whole network with Raspberry Pi
Things to prepare
To complete this tutorial, you will need:
After assembling the tools, you are ready to create ad blockers across the network.
Install Pi-Hole on Raspberry Pi
First, attach an external keyboard, monitor, and any other peripheral to the Raspberry Pi, then attach the Pi to the power source.
As soon as the Raspberry Pi boots up, you're ready to download the Pi-Hole installation script. Just launch Terminal (by clicking the Terminal icon in the Raspbian toolbar), then enter the following command in the Terminal window:
curl -sSL https://install.pi-hole.net | bash
Press Enter
. Raspbian will download the script and start the device configuration process to use Pi-Hole.
After a few moments, the Pi-Hole setup screen will automatically launch.
After running the installation script, the Pi-Hole setup dialog will automatically launch.
Keep pressing Enter
to switch through the introductory screens until you are asked to let the Pi-Hole work over WiFi ( wlan0 ) or Ethernet ( eth0 ).
Use the arrow keys to select wlan0 or eth0 (this guide is using WiFi) and press Enter
.
Choose a DNS provider
You need to choose an upstream DNS provider, which will be responsible for answering queries for non-advertising domains.
Pi-Hole supports the following pre-installed DNS providers, but you can enter your provider by selecting Custom.
This guide is using Google, but you can choose any DNS provider you like.
Which blacklist should Pi-Hole use?
Specifies a list that Pi-Hole should use to identify and block unwanted content.
Specifies a list that Pi-Hole should use to identify and block unwanted contentUnless you have a specific reason to change these settings, leave the default options as they are.
Choose Internet Protocol IPv4 or IPv6 (or both)?
It doesn't matter whether you choose IPv4 or IPv6, but if you want to block as many ads as possible, you should choose both IPv4 and IPv6.
Configure static IP address
Use current network settings as static address Pi-Hole. Assuming you are very satisfied with the information displayed on the screen, use the arrow keys to select Yes , then press Enter
.
Read the disclaimer carefully and if you agree, select OK.
Tracking Pi-Hole with web administration interface
You will be asked if you want to install the Pi-Hole web administration interface. This interface provides insight on how the Pi-Hole works online, so you should choose to install the web interface when prompted.
You should choose to install the web interface when promptedIf you are installing the web management interface, you should also install lighttpd web server when prompted.
Log Pi-Hole data
You can choose to disable Pi-Hole logging capabilities, but you should enable it, as they provide some useful information.
You will be prompted to select the privacy mode for FTL, this is the level of information that will be included in Pi-Hole statistics. Choose one of the following options:
Log in to your Pi-Hole account
The setup dialog box will display the address of the Pi-Hole web administration interface and the password you need to log into this interface. Please record this information!
If you access the provided URL, you will encounter the standard Pi-Hole web interface and be able to log in with your password.
The web administration interface is divided into the following sections:
This is only a brief overview of the Pi-Hole web administration interface. It is well worth the time to explore this interface in more detail!
Resovle problem
While configuring Pi-Hole, you may encounter the following error in the Terminal window:
'Could not resolve host FTL Engine not installed.'
If you see this message, run the following Terminal command:
sudo nano /etc/resolv.conf
This command will launch the resolv.conf file in the Nano editor. You need to add the IP address of the selected DNS provider to the resolv.conf file. For example, this tutorial is using Google as a DNS provider, so a quick search on Google suggests that 8.8.8.8 should be added to resolv.conf:
nameserver 8.8.8.8
To save the changes, use the shortcut Ctrl
+ O
, then press Y
when prompted.
Close resolv.conf using the Ctrl
+ shortcut X
.
Relaunch the Pi-Hole setup conversation by running the following Terminal command:
curl -sSL https://install.pi-hole.net | bash
You can now complete the setup dialog box without any errors.
Update the router: Create an ad blocker all over the network
You are ready to update your device or router to use Pi-Hole. If you want to block ads on all devices connected to the network, you'll need to change the router's DNS settings to point to the Raspberry Pi device.
The process of changing the router's DNS settings will vary depending on the router model, but overall, you'll need to:
hostname -I
For instructions on how to update your router's DNS settings, check the manufacturer's website or the documentation that came with the router.
How to block online ads on specific devices
You can also change DNS settings for specific devices and operating systems.
1. Windows
To update DNS settings on Windows:
Windows PC is now set up to use the Pi-Hole ad blocker.
2. Linux
If you are a Linux fan, you will need:
Alternatively, you can update your DNS settings by opening the /etc/resolv.conf file .
3. macOS
To update DNS settings in macOS:
Pi-Hole will collate all your requests with the blacklist and block as many ads as possible.
4. iPhone
If you own an iPhone or iPad, then:
5. Android
To block ads on Android:
While using the Raspberry Pi as an ad blocker, it can also be used as a WiFi access point or personal web server.
ncG1vNJzZmismaXArq3KnmWcp51kwba%2BzWawqK2iYr%2Biv8%2BbnKuqqWK9qnnIp6uoZZGjeqKwjJujqJubmr8%3D