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

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:BeginnerSource available

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

Source: GitHub
Also from: pi-hole.net
License: unknown (custom/multiple – see repo)
Last verified: 10/15/2026
Pi-hole: network-wide ad blocking on Raspberry Pi

Illustration

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.

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.

No verified link — check the original project

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.

No verified link — check the original project

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

Download CSV

Related Projects

ESP32 AdBlocker: network-wide ad blocking, no Raspberry Pi
Illustration
ESP32ESP32-S3
One ESP32-S3 N16R8 board becomes a Pi-hole-style DNS ad blocker for your whole home network — every device covered, with reports to your phone.
Beginner·Code
2 parts listed
Syndetis: a pocket Ethernet tester on the WT32-ETH01 ESP32
Illustration
ESP32
Free MIT firmware turns the WT32-ETH01 ESP32 into a pocket Ethernet tester: link speed, DHCP, LLDP neighbors and ping on an OLED, plus a phone web dashboard.
Intermediate·Code
6 parts listed
SSH.RP: a real SSH server on a bare RP2040
Illustration
RASPBERRY PI PICORP2040
SSH.RP runs a real SSHv2 server on an RP2040 board with W5500 Ethernet: stock OpenSSH clients, Ed25519 key login, a shell on the bare MCU.
Beginner·Code
4 parts listed