AI agents & screen readers: for a machine-readable, text-only catalogue, start at /llms.txt. Products are available as Markdown (/products.md, /products/{handle}.md) and JSON (/products.json, /products/{handle}.json).
Store

What you'll build

A network-wide ad and tracker blocker. Phones, TVs and laptops on your network see fewer ads and trackers, with nothing to install on each one.

Difficulty
Beginner
Build time
About 45 minutes, plus your router's settings
Parts
7 parts to choose

Build total

$224.75

Review the parts

1 thing to sort out before the build goes in the cart.

Raspberry Pi 4 Model B

Shopping list

One recommended part for each job, checked against the others. Swap any of them, or skip what you already own.

Everything for Raspberry Pi 4

Your setup

Tell us what you have. We check the build against it and change the steps to match.

Can you change the DNS server your router hands out?

Pi-hole only filters devices that use it for DNS. The simplest way is for the router to hand the Pi's address to every device. Log in to the router and look for DNS under its LAN or DHCP settings.

  • Check: Router: check whether you can change the DNS server it hands out. That decides how your devices will use the Pi.
Does your home network use IPv6?

Devices also get a DNS server over IPv6, announced by the router. Unless that's the Pi, a device with IPv6 can ask the router's instead and go around Pi-hole. The router's settings show whether IPv6 is on.

  • Check: IPv6: check in your router's settings whether it's on. If it is, its IPv6 DNS setting needs to point at the Pi too.
Does anything on your network already choose its own DNS?

Pi-hole only filters the lookups that reach it. It already stops Firefox's automatic DNS-over-HTTPS and Apple's iCloud Private Relay from going around it.

Where will the Pi live?

It has to stay on and connected: while it's off, devices that use it can't look up any website.

  1. Board Required

    Pi-hole needs 512MB of memory and 2GB of space, so the smallest Raspberry Pi 4 is plenty, with Gigabit Ethernet for the router. Already have a Raspberry Pi 3, 4 or 5? Choose it and the list keeps the parts that fit it.

    See all Raspberry Pi Boards
    • Note: The Raspberry Pi 4 Model B 1GB we recommend is out of stock, so the build uses the Raspberry Pi 4 Model B 3GB ($68.39 more).
    Board: choose one
    View
    View
    View
  2. Power Required

    Raspberry Pi 4 takes the official 15W USB-C supply, and Raspberry Pi 5 the 27W. With a PoE HAT, the Ethernet lead powers the Pi instead.

    See all Power Supplies
    Power: choose one
    View
  3. PoE injector Optional

    A PoE HAT takes its power from the Ethernet lead, so something has to put power on it: a PoE switch, or this injector between the router and the Pi. Its mains lead isn't included.

    PoE injector: choose one
  4. Storage Required

    Pi-hole needs 2GB of free space, so a 32GB card leaves plenty. A blank card lets you set up the Pi from your computer; the pre-loaded card starts with a setup wizard on a monitor.

    See all Storage
    Storage: choose one
  5. Case Required

    Pi-hole barely works the processor, so a plain case is all it needs.

    See all Cases
    Case: choose one
    View
  6. Ethernet lead Optional

    Every lookup in the house goes through the Pi, so plug it into the router or a switch. With the PoE injector you need two: router to injector, injector to Pi.

    See all Cables & adapters
    Ethernet lead: choose one
    Up to 3
  7. Reading Optional

    A digital guide to setting up and customising Pi-hole, for more than this page covers.

    Reading: choose one

Your build

Raspberry Pi 4 Model B 3GB

  • Raspberry Pi 4 Model B 3GB $139.00
  • Raspberry Pi Power Supply USB-C 5V 15W White $24.05
  • Raspberry Pi A2-Class microSD Card, 32GB, Blank $47.00
  • Raspberry Pi 4 Case $9.00
  • Ethernet Lead CAT 5E 1m $5.70
Build total $224.75

Worth checking

  • Router: check whether you can change the DNS server it hands out. That decides how your devices will use the Pi.
  • IPv6: check in your router's settings whether it's on. If it is, its IPv6 DNS setting needs to point at the Pi too.

Fits are checked against the makers' documentation and our own case records. Anything we haven't confirmed says “Not checked”.

Link to this build: bookmark or share it to come back to these choices.

5 parts · 1 thing to sort out

$224.75

How the build goes

For the parts in your shopping list. Change a part and these change with it.

  1. Put Raspberry Pi OS Lite on the card

    On your computer, open Raspberry Pi Imager and choose your Raspberry Pi, Raspberry Pi OS Lite (64-bit) and the card. In its settings, set a hostname (pihole, say), a user and password, and turn on SSH; add your Wi-Fi too if the Pi won't be wired.

    It worked if Imager says the card is written and verified.

  2. Start it up

    Put the card in the Pi, plug it into the router or switch with the Ethernet lead (unless it's on Wi-Fi), then connect the power.

    It worked if after a minute or two, ssh with your user name at the hostname plus .local (ssh you@pihole.local) logs you in from your computer.

  3. Give the Pi a fixed address

    Pi-hole needs an address that never changes. In your router, reserve the Pi's current address for it (a DHCP reservation); hostname -I on the Pi shows the address.

    It worked if the Pi has the same address after sudo reboot.

  4. Install Pi-hole

    Log in over SSH and run curl -sSL https://install.pi-hole.net | bash. Choose an upstream DNS provider when it asks, and note the web interface password it shows at the end (pihole setpassword changes it).

    It worked if pihole status says blocking is enabled, and the dashboard opens at the Pi's address followed by /admin.

  5. Note your router's settings first

    Before you change anything, write down or photograph your router's DNS and DHCP settings, so you can put them back in a minute.

  6. Point your router at the Pi

    In the router's home-network (LAN or DHCP) settings, set the DNS server to the Pi's address. Set a second DNS server to the Pi too, or leave it empty: any other server lets devices go around Pi-hole. Then reconnect a device (turn its Wi-Fi off and on).

    It worked if that device's lookups appear in Pi-hole's Query Log, and on a computer nslookup example.com names the Pi's address as the server.

  7. Check it's blocking

    Use a phone or laptop as normal for a few minutes, then open the dashboard.

    It worked if the dashboard counts queries blocked, and the Query Log shows your devices by name or address.

  8. If something stops working

    To let something through for a while, run pihole disable 5m (pihole enable turns blocking back on). If the Pi is off or broken, devices can't look anything up, so put back the router's DNS setting you wrote down until it's running again.

Guides for this build

Questions

Which Raspberry Pi does it need?

Pi-hole needs 512MB of memory and 2GB of free space, and runs on Raspberry Pi OS, so any Raspberry Pi 3, 4 or 5 has plenty. We suggest the 1GB Raspberry Pi 4. When it's sold out the list uses the next one in stock and shows the difference in price before you add it.

Can I use a Raspberry Pi I already have?

Yes. Under Board, choose the Raspberry Pi you have. The list then keeps the power supply and case that fit it, or you can mark those as yours too.

Do I need a monitor?

Not with a blank card: Raspberry Pi Imager's settings set your user, SSH and Wi-Fi before the first start, so you set the Pi up from your computer. The pre-loaded card starts with a setup wizard, which needs a monitor, keyboard and mouse once.

Will it block YouTube ads?

Not reliably. YouTube serves ads from the same servers as the videos, so DNS blocking can't separate them. Most other ads and trackers are blocked.

What happens if the Pi is switched off?

Devices that use it can't look anything up, so the internet seems to be down. Put your router's DNS (or DHCP) setting back to what it was until the Pi is running again.

Should I add a second DNS server as a backup?

Not a different one. Devices use either server, so lookups slip past Pi-hole even while the Pi is up. If you want a backup, Pi-hole's own advice is a second Pi-hole.

More for this build

Fits Raspberry Pi 4
Maddy from the Pi Australia team

Need help? We're here for you!

Hi, I'm Maddy. My team and I are ready to help with your order or any questions.