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
- Zero 2 W: sold out at US resellers 2026-11-20; in stock at The Pi Hut at £14.40
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. Zero 2 W stock has been scarce since the 2026 SBC shortage; the Parts list notes where boards were in stock at the last check.
Source & Attribution

Illustration
How to Build It
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.
Bill of Materials
Parts list
3 parts · 1 linked
Heads up: some Buy links are affiliate links. If you buy through one, MCU Atlas may earn a small commission at no extra cost to you. It never changes which parts we list. How this works
1× Raspberry Pi
Sold out at US resellers - PiShop.us still shows the $17.25 list price with zero stock and Adafruit lists it out of stock (both checked 2026-11-20); in stock at The Pi Hut (UK) at £14.40 at the same check. Pi-hole also runs on any larger Pi you already own.
1× Power supply
Official Raspberry Pi 12.5W Micro USB supply, which is what a Zero 2 W takes - $8.80 in stock at PiShop.us (checked 2026-11-20). A Pi 4 or Pi 5 build uses the USB-C supply instead.
1× microSD
SanDisk Ultra 32GB Class 10 blank - $13.95 in stock at PiShop.us (checked 2026-11-20); card prices have climbed with the 2026 memory shortage.
Not included: 3D-printed case, wire, solder, USB cable
Related Projects



