Last reviewed: October 8, 2026 · 10 min read

Pi-hole basics: block ads and trackers on every device at home

Pi-hole is free, open-source software that blocks ad and tracking domains for your whole network: phones, smart TVs, tablets, even devices where you can’t install an ad blocker. It’s a great weekend project, and this guide covers the parts most tutorials skip, like what to do when it goes down.

What Pi-hole does (and doesn’t)

Every time a device loads a web page or an app, it looks up names like example.com using DNS, the internet’s phone book. Pi-hole becomes your home’s DNS server. When a device asks for a known ad or tracking domain, Pi-hole answers “nothing here”, and the ad never loads.

It’s good at: banner and pop-up ads served from separate ad domains, tracking and telemetry domains in apps and smart TVs, and showing you exactly what your devices are contacting.

It can’t block:

Think of it as a strong first layer, not a complete replacement for an in-browser blocker.

What you need

Install it

  1. Prepare the Pi. Use Raspberry Pi Imager to write Raspberry Pi OS Lite to the card. In the Imager’s settings, set a username and password, enable SSH and set your Wi-Fi if you won’t use Ethernet.
  2. Give it a fixed address. Boot the Pi, find it in your router’s device list, and create a DHCP reservation so it always gets the same IP address (for example 192.168.1.53). Write that address down; you’ll need it.
  3. Connect and update. From a computer, run ssh yourname@192.168.1.53, then:
    sudo apt update && sudo apt full-upgrade -y
  4. Run the official installer. The Pi-hole project’s one-step install is:
    curl -sSL https://install.pi-hole.net | bash
    If you prefer to read a script before running it (a good habit), download it first, read it, then run it with sudo bash basic-install.sh. The official docs at docs.pi-hole.net cover both methods and Docker.
  5. Answer the prompts. Choose an upstream DNS provider, the service Pi-hole asks for everything it doesn’t block. Privacy-focused public resolvers such as Quad9 or Cloudflare are common choices. Keep the default blocklist to start.
  6. Set the admin password:
    sudo pihole setpassword
  7. Open the dashboard at http://192.168.1.53/admin, using your Pi’s address.

Point your network at it

Pi-hole only works for devices that use it for DNS. Pick one approach:

Option A: change the DNS your router hands out (recommended)

In your router’s DHCP or LAN settings, set the DNS server to your Pi-hole’s address. Then restart devices, or wait for them to renew, so they pick up the change.

Don’t add a public DNS server as “secondary DNS.” Devices don’t use DNS servers strictly in order. Many will happily use the secondary and skip your Pi-hole. If you want redundancy, run a second Pi-hole and list both.

Option B: let Pi-hole be the DHCP server

If your router won’t let you change DNS, turn off the router’s DHCP server and turn on Pi-hole’s (Settings → DHCP). Only one DHCP server should run on a network. Do the switch-over when nobody is mid-video-call.

Option C: set it per device

Set DNS manually on individual devices. This is handy for testing before you switch the whole house.

Check it’s working

Living with Pi-hole

Plan for when it’s down

Once your whole network uses Pi-hole, a dead Pi means “the internet is broken” for everyone at home, even though your connection is fine. Decide now what you’ll do:

  1. Write down how to undo it: “Router settings → LAN → DNS: set back to automatic.” Keep the note where another family member can find it.
  2. Back up your settings using the dashboard’s backup/export feature (Settings → Teleporter) after you change anything.
  3. Consider a second Pi-hole on another device and give both addresses to your router. Small tools exist to keep the two in sync.
  4. Use a decent power supply and storage. Cheap power supplies and worn-out SD cards cause most Pi failures.

What to buy

Already have a NAS or an old laptop that stays on? Pi-hole runs happily in Docker or on most Linux systems, so you may not need to buy anything.