Pi-hole – Network-wide Ad Blocking
Pi-hole is DNS sinkhole that protects your devices from unwanted content.
Install
| 1. Prepare your system: | Ensure your device is running a supported OS (Raspberry Pi OS, Ubuntu, Debian, etc.) |
| 2. Update your system packages: | sudo apt update && sudo apt upgrade -y |
| 3. Install Pi-hole: | curl -sSL https://install.pi-hole.net | bash |
| 4. Configure Pi-hole: | DNS Provider, Blocklists, Network Interface and Static IP Address |
Update
| Update pi-hole | sudo pihole -up |
| Update Gravity list | sudo pihole -g |
| Update with reboot | sudo apt update && sudo apt upgrade -y && sudo pihole -up && sudo pihole -g && sudo reboot |
Commands
| Change password | sudo pihole setpassword |
Setup DNS
Setup your DNS-servers to use Cloudflare’s public DNS resolver:
| Cloudflare | Default | Block Malware | Block Malware and Adult Content |
|---|---|---|---|
| IPv4 Primary | 1.1.1.1 | 1.1.1.2 | 1.1.1.3 |
| IPv4 Secondary | 1.0.0.1 | 1.0.0.2 | 1.0.0.3 |
| IPv6 Primary | 2606:4700:4700::1111 | 2606:4700:4700::1112 | 2606:4700:4700::1113 |
| IPv6 Secondary | 2606:4700:4700::1001 | 2606:4700:4700::1002 | 2606:4700:4700::1003 |
Allow Google Search
To allow Google search without everything being blocked, you need to whitelist domains:
www.googleadservices.com
ad.doubleclick.net
Adlists