Skip to content
MCU Atlas
RASPBERRY PIPI-ZERO-2-WPI-4Draft

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.

Difficulty:BeginnerCost:Source available

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

Source: GitHub
License: unknown (custom/multiple – see repo)
Last verified: 10/16/2026
How to Build It
Pi-hole is a DNS sinkhole that blocks ads and trackers for every device on your network, with no client software. It runs happily on any Raspberry Pi and includes a web dashboard showing which queries were blocked.

Parts Needed

  • Any Raspberry Pi (Zero 2 W or newer)
  • microSD card with Raspberry Pi OS Lite
  • Power supply
  • Ethernet cable (recommended)

Steps

  1. 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. 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. 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. 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. 5

    Use the dashboard

    Open http://<pi-ip>/admin to see query stats, add blocklists and whitelist sites that break.

  6. 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.

Parts List (BOM)
Parts list inferred by MCU Atlas — check the original
inferred
PartQtyRoleEst. PriceBuy
1main board$15–$20View
1power$8–$12View
1storage$4–$8View
Estimated Total$27–$40 USD

Not included: 3D-printed case, wire, solder, USB cable

Download CSV

Related Projects

PiKVM: open-source IP-KVM on Raspberry Pi
Illustration
RASPBERRY PIPI-4Draft
Remote keyboard, video and mouse control of any computer over the network, even in the BIOS, using a Raspberry Pi.
Intermediate·Cost varies·Code
4 parts listed
MagicMirror2: modular smart mirror on Raspberry Pi
RASPBERRY PIPI-4Draft
Open-source modular smart-mirror software showing calendar, weather and news behind a two-way mirror, usually on a Pi.
Intermediate·Cost varies·Code
4 parts listed
Pwnagotchi: e-ink Wi-Fi learning pet on Pi Zero
RASPBERRY PIPI-ZERODraft
A Raspberry Pi Zero W with an e-ink face that learns to capture Wi-Fi handshakes, framed as a virtual pet.
Advanced·Cost varies·Code
4 parts listed