Have you ever tried reading a supposedly well-meaning blog but every time you try to scroll down or browse through the pictures, advertisements just keep popping out, blinking, and insistently distracting you from what you are doing?
It is no secret that a majority of websites exist with the support of advertisements, from small blogs to big publishing websites. Most of them depend on ad revenues to continue their business. However, through the years, these advertisements have become increasingly aggressive and invasive. Thus, ad blockers came to light as the solution.
While browser-based ad blockers have been steadily popular and on-demand, there are still some limitations to them. Enter Raspberry Pi, a hole-in-one ad blocker system that can save you tons of data and time on any and all of your devices.
What is Raspberry Pi?
Raspberry Pi was launched in 2012 and there have been several variations since then. It is a low-cost and small-sized computer that can be plugged into a computer monitor and even a television. It enables people to explore and learn how to program. This handy device is capable of everything you would expect from a normal desktop computer, from internet surfing to gaming.
In fact, it has been used in an array of projects from creating music machines to weather stations, and even birdhouses with infrared cameras. But if you want to know how to use a Raspberry Pi as an ad blocker for your network, this guide is just what you need.
Hardware needed for this project:
- A Raspberry Pi Power Supply
- Raspberry Pi
- A USB Micro SD Card Reader
- Micro SD Card for Raspberry Pi
- USB drive/external hard disc – this is optional but helpful to save big download files
- Network Cable for your Raspberry Pi or WLAN adapter
- First, you have to install DietPi, which is the operating system needed for Raspberry Pi. It’s a small, easy, and fast OS that supports Raspberry Pi.
- Install and then configure the Pi-hole software. This will be the software that will be used to block the ads. For the download of Pi-hole, you have to connect it to your Raspberry Pi through Putty and then open the DietPi launcher using the command: dietpi-launcher
- Open the DietPi-Software menu and go to Browser Software where a list of available software in DietPi should appear.
- Find the entry Pi-hole under the DNS Servers category, confirm this selection using OK.
- Select if you would want to use Unbound as the recursive DNS server. Unbound is a secure and fast DNS server that can be advantageous in many ways.
With Unbound you can maintain your privacy as no server can track your exact paths. It also uses caching, so that all DNS queries are answered promptly, decreasing traffic and increasing the performance of applications that use DNS. Lastly, you are protected from potential phishing sites.
Using Unbound, you can check whether the hostname of your bank matches an actual IP address.
- In this next step, you will need a static IP address. However, if you have already configured it on your router as instructed during the DietPi setup, you can go ahead and skip this step.
- After step 6, you will get redirected to the DietPi Software where you can now start installing Pi-hole. Select Install to confirm and start the installation process.
- You will know that the installation is successful when the screen says that the “installer will transform your device…”. Just go through the next steps until you are asked to select DNS Provider.
- You can opt to install the web admin interface, which is highly recommended to have easy access and control of Pi-hole.
- You will then have to choose whether you would like to log queries. Select which mode of privacy you’d like to use. Now, if you prefer to show everything, you can choose to hide domains and clients; and if you want to operate it as anonymous, you can also choose the anonymous mode.
- Finally, at the last step, you will have to wait a bit until the configuration is done and you will be shown a confirmation window. The screen will show you two important pieces of information which are:
- Web interface address so you can open it in your browser
- And an IPv4 address that you need to use to work as your DNS server
Remember to write this information down and proceed with the set up.
Final set up:
- You will be asked if you’d like to block public access on the Pi-hole admin panel. This means that only a VPN or connections from within your LAN are possible. This is highly recommended to keep your network safe and secured.
- After that, you will be redirected to the dietpi-launcher start page indicating that Pi-hole is installed and ready to use.
- To check usability, you can try opening the web admin interface
Password: <your-global-software-password> default would be dietpi
- If you are successful, the window will show the Pi-hole in the browser.
- You can run Pi-hole on any devices using two options
- By changing the DNS server of your device
- And by changing the DNS server for all your devices that are connected to your local network via changing the DNS server on your router.
Benefits of using Raspberry Pi as an ad blocker
Using Raspberry Pi as an ad blocker gives you a better online experience without advertisements and invasion of your privacy. It blocks any ad even before it reaches your devices, which means you do not even need to take any further action to your devices because the ads would never even reach your devices.
It is different from your traditional ad-blockers because installing the Pi-hole once on your network can protect all your devices from ads, even in non-traditional places such as in TVs and games. Pi-hole functions as an internal DNS server that intercepts any queries of known ad-serving domains, denying them access so that the ads will not be downloaded.
The most obvious reason to use this, of course, is to eliminate advertising from internet surfing. However, this can also reduce data usage especially for those with limited data plans and in mobile devices.
Using Raspberry Pi as an ad blocker can also protect you from adverts using scripts that can easily exploit and access user’s sensitive information. Plus, it can reduce battery usage, enable webpages to load faster, and protect you from malware.
If you want to learn more about advanced configuration options for Pi-hole check, https://dietpi.com/docs/software/dns_servers/#pi-hole, and https://pi-hole.net/.