Pi-hole – Network-wide Ad Blocking

Last modified date

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-holesudo pihole -up
Update Gravity listsudo pihole -g
Update with rebootsudo apt update && sudo apt upgrade -y && sudo pihole -up && sudo pihole -g && sudo reboot

Commands

Change passwordsudo pihole setpassword

Setup DNS

Setup your DNS-servers to use Cloudflare’s public DNS resolver:

CloudflareDefaultBlock MalwareBlock Malware and Adult Content
IPv4 Primary1.1.1.11.1.1.21.1.1.3
IPv4 Secondary1.0.0.11.0.0.21.0.0.3
IPv6 Primary2606:4700:4700::11112606:4700:4700::11122606:4700:4700::1113
IPv6 Secondary2606:4700:4700::10012606:4700:4700::10022606: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

firebog.net