Not in the mood for online advertising? (Spoiler: Pi Hole helps)
How can I block adverts in apps where no ad blocker is available?
I’ll show you the PI Hole, which bans such adverts forever.
Basics: What is the Pi Hole?
Pi Hole is a free software for blocking tracking and advertising URLs. The software was originally developed for the Raspberry Pi microcomputer, which is designed to encourage experimentation with software and hardware.
Your router uses the Pi Hole as a DNS server that blocks adverts and malicious domains. During installation, you integrate the Pi Hole into your private computer network and say bye-bye to advertising.
When resolving domain requests, Pi Hole filters out advertising and tracking. Your Pi Hole updates the new advertising URLs every day.
Isn’t an Ad Blocker for the Browser Enough?
The ad blocker in the browser does not remove adverts in apps/programs that run outside the browser.
Large advertising companies pay a lot of money to “Adblock Plus” to display a small proportion of “non-offensive” adverts.
Pi Hole protects you universally with a network firewall that protects all devices behind the firewall from the annoying adverts.
10 Reasons to use Pi Hole
Why should I use Pi Hole? Here I list a few advantages of Pi Hole, some of which are mentioned on their GitHub page:
- You don’t have to look at ads any more (Best ad blocker)
- The software protects you from malware advertising. Hackers buy adverts from advertising platforms to execute malicious code on your computer.
- Your websites load faster because Pi Hole caches the requested IPs for you. If Pi Hole does not know the requested URL, the DNS provider Cloudflare supports fast DNS resolution.
- You can observe and monitor all your network traffic. Watch how the big tech companies fail to spy on you with tracking software (insert evil laugh here).
- The software interrupts the tracking of your devices for analysis tools with fingerprinting (user identification based on screen size, browser version, IP address, operating system version, cookies and other behaviour on a website)
- A loaner installs PI Hole in less than 10 minutes via the console
- The ad blocker blocks adverts outside the browser, e.g. in news apps
- Visualise DNS requests and activities via the dashboard with diagrams
- Suitable for IPv4 (old) and IPv6 (new)
- Not only suitable for Raspberry Pi, but the software is highly scalable for corporations based on more server performance
Limitations and Disadvantages of the Ad Blocker
Pi Hole is only almost a “god” ad blocker.
The software can only filter what is on the blacklist. The software lets unknown or new IPs through. No ad blocker in the world filters out adverts from videos (product influencers) or hard-coded adverts on websites.
Technologies PI Hole uses
Technically, the software uses dnsmasq, cURL, lighttpd, PHP and AdminLTE
- Dnsmaq converts the easily memorised URLs we know into an Internet Protocol address. This acts as a DNS cache to avoid lengthy DNS resolution.
- cURL is a command line tool for using various Internet protocols such as HTTP, Telnet, Gopher, FTP..
- lighttpd is a highly efficient, super lean web server with compression, URL rewriting and strong authentication.
- PHP is a server-side programming language for dynamically displaying content on an HTML framework. A large part of the web (e.g. all WordPress blogs) use PHP.
Step-by-Step Tutorial for Pi Hole
All computers are suitable for the installation, especially Raspberry PI’s and microcomputers (for home use).
Prepare the Hardware
- Connect the mouse, keyboard and a monitor to the Raspberry Pi
- Activate the Secure Shell (SSH) with the start of the Raspberry Pi Configuration
Preferences > Interfaces > Enable SSH
- Click on
Ok
- Open the terminal and enter
ipconfig
and the IP address of the Raspberry Pi should display the console - Optional: Physically move your Raspberry. You will need the power cable and a network cable or an activated W-Lan module on your Raspberry Pi to continue.
SSH and Installing the Software
- Download Putty for Windows
- Install Putty and start the software
- Enter the Raspberry Pi’s IP address (for Host Name) in the GUI of Putty and enter port 22 with Connection Type SSH.
- Save your SSH session
- Click on Open and you now have shell access to your PI if you enter the correct credentials. SSH is suitable for remote control of the PI.
- Type in
sudo curl -sSL https://install.pi-hole.net | sudo bash
- Give your Pi time for the installation and follow the installation menu of the software. Confirm everything with “Yes” if you do not want any special configuration. (10 minutes)
- Go to the Windows browser and enter
http://Pi-IP-ADRESSE-HIER/admin/index.php
with the IP address of the PI. PI-Hole works so far.
Configuration of Your Router
- Log in to your router
For Fritz!Box: http://fritz.box/ - Activate the extended view with the three dots at the top right
- Go to
Internet > Access data > DNS server tab
- Enter there:
Favourite DNSv4 server: Your Pi IPv4 address
Alternative DNSv4 server: Cloudflare with 1.1.1.1
Preferred DNSv6 server: Your PI IPv6 address
Alternative DNSv6 server: Cloudflare with 2606:4700:4700::1111 - Take over
- Log out
- For testing, surf a few websites to generate some traffic
- Go to
http://PI-IP-ADRESSE-HIER/admin/index.php - The Pi should now block ad traffic.
How does Pi Hole Work? … with Blocklists!
The software blocks about 90,000 DNS advertising requests from the start if you work with the standard configuration.
I have compiled a file with various sources (2,900,000 entries).
The file contains 99 URLs to text files on GitHub that list URLs that should be blocked.
What is on the list?
- Advertising platforms for displaying user-specific adverts with advertising IDs and tracking (Google AdSense, affiliate stuff)
- Fingerprinting, tracking, analysis software for tracking users (Google Analytics, other analysis software, in-app analysis)
- Known malicious websites that contain malware, viruses, Trojans, etc. (Provided on AWS)
Alternative Projects Firewall with Raspberry Pi
ipFire is an open source project that divides your network into different zones (Demilitarised Zone and Local Area Network). The software uses Stateful Packet Inspection (SPI) based on an IP filter.
With the firewall, you can mitigate or completely block DDoS attacks to prevent your server from going down.
If you are not working from home, you can use VPN to connect securely to your home network. ipFire uses ipSec and OpenVPN.
You can convert the software into a TOR node, use it as a backup server or expand it into a wireless access point.