Pi-hole: network-wide ad blocking on Raspberry Pi
A DNS sinkhole that blocks ads and trackers for every device on your network, classic first Raspberry Pi project.

Key Facts
- Board: any Raspberry Pi (Zero 2 W+)
- Role: network DNS sinkhole
- UI: web dashboard
- Install: one-line script or Docker
About This Project
Pi-hole runs as your network's DNS server and refuses to resolve known ad and tracking domains, so every phone, TV and laptop benefits without installing anything. It has a web dashboard with query stats and allow/deny lists, and runs happily on a Raspberry Pi Zero 2 W or larger. Install is one script, which is why it is one of the most-recommended first Pi projects.
Source & Attribution

Illustration
Parts Needed
- Any Raspberry Pi (Zero 2 W or newer)
- microSD card with Raspberry Pi OS Lite
- Power supply
- Ethernet cable (recommended)
Steps
- 1
Prepare the Pi
Flash Raspberry Pi OS Lite with Raspberry Pi Imager, enable SSH, boot the Pi and give it a static IP (or a DHCP reservation on your router).
- 2
Install Pi-hole
Either run the official one-line installer, or (recommended if you want to read the code first) clone the repo or download basic-install.sh and run it with sudo. A Docker image is also available.
- 3
Follow the installer
Choose your upstream DNS provider and accept the default blocklist. Note the admin password the installer shows at the end.
- 4
Point your network at it
In your router's DHCP settings, set the Pi's IP as the DNS server so every device uses Pi-hole automatically.
- 5
Use the dashboard
Open http://<pi-ip>/admin to see query stats, add blocklists and whitelist sites that break.
- 6
Tips
Run pihole -up to update it. If something on your network breaks, check the query log to find which domain is being blocked.
Not included: 3D-printed case, wire, solder, USB cable
Related Projects


