guide ยท #homelab ยท 15 min
Build a Pi-hole Ad Blocker for Your Entire Network
Cech Tech Reviews
Block ads on every device in your home, including phones, smart TVs, and IoT devices, without installing anything on individual devices. Works at the DNS level.
- 1
Run Pi-hole in Docker
docker run -d \ --name pihole \ --restart unless-stopped \ -p 53:53/tcp -p 53:53/udp \ -p 8053:80 \ -e TZ=America/Chicago # Change to your timezone (e.g., America/New_York, Europe/London, Asia/Tokyo) \ -e WEBPASSWORD=yourpassword \ -v ~/pihole/etc:/etc/pihole \ -v ~/pihole/dnsmasq:/etc/dnsmasq.d \ pihole/pihole:latest
- 2
Access the admin dashboard
Open /:8053/admin and log in with the password you set. You will see real-time stats on queries and blocked domains.
- 3
Point your router's DNS to Pi-hole
In your router settings, change the DNS server to the IP address of the machine running Pi-hole. Every device on your network now routes DNS through Pi-hole.
- 4
Add blocklists
The default blocklist is good, but add more at Settings > Adlists. Popular lists: Steven Black's Unified Hosts, OISD, and Hagezi's lists. Apply and update gravity.
- 5
Whitelist anything that breaks
Some sites stop working when ads are blocked. Check the Query Log to find the blocked domain and whitelist it. Common ones: s.youtube.com, cdn.optimizely.com.
