Running Pi-hole on a Raspberry Pi Zero 2W
raspberry pipi holednsad blockingnetwork
Pi-hole is a network-wide DNS ad blocker. Every device on your network gets ad blocking without installing anything on each device. The Pi Zero 2W is the perfect low-power host.
What You Need
- Raspberry Pi Zero 2W
- MicroSD card (8GB+ is enough)
- Micro USB power supply (2A+)
- Ethernet adapter or WiFi (Zero 2W has built-in WiFi)
Step 1 โ Flash Raspberry Pi OS Lite
Use Raspberry Pi Imager:
- OS: Raspberry Pi OS Lite (64-bit) โ no desktop needed
- Settings (โ๏ธ):
- Enable SSH
- Set WiFi credentials
- Hostname:
pihole.local - Username/password
- Write to SD card, boot Pi Zero 2W
Step 2 โ Assign Static IP
Before installing Pi-hole, give the Pi a static IP on your router.
In your router admin (usually 192.168.1.1 or 192.168.0.1):
- Find the Pi's MAC address in DHCP clients list
- Reserve/assign a static IP (e.g., 192.168.1.50)
- Note this IP โ you'll configure Pi-hole to use it
Step 3 โ Install Pi-hole
SSH into your Pi:
ssh [email protected]
Run the installer:
curl -sSL https://install.pi-hole.net | bash
Follow the installer prompts:
- Upstream DNS: Cloudflare (1.1.1.1) or Quad9
- Blocklists: keep default, add more later
- Install web admin: Yes
- Log queries: Yes
- Privacy mode: 0 (Show everything)
Note the admin password shown at the end.
Step 4 โ Point Your Router to Pi-hole
In your router DNS settings:
- Primary DNS: your Pi's static IP (e.g., 192.168.1.50)
- Secondary DNS: 1.1.1.1 (fallback if Pi-hole goes down)
All devices on the network now route DNS through Pi-hole.
Step 5 โ Admin Interface
Go to: http://pihole.local/admin
Login with the password from installation.
Dashboard shows:
- Queries today / blocked percentage
- Top blocked domains
- Per-client breakdown
Adding Better Blocklists
Settings โ Adlists:
| List | Source |
|---|---|
| Firebog Ticked Lists | v.firebog.net/hosts/lists.php |
| OISD Full | big.oisd.nl |
| HaGeZi Multi Ultimate | raw.githubusercontent.com/hagezi/dns-blocklists |
Add URL โ Save โ Tools โ Update Gravity to apply.
Tips
- Whitelist domains that break: Settings โ Whitelist
- Query log shows what's being blocked โ useful for troubleshooting
- Keep Pi-hole updated:
pihole -upvia SSH - Pi Zero 2W uses ~1W of power โ leave it running 24/7