Pi-hole Setup to Block Ads on Your Whole Home Network
Every phone, smart TV and laptop in your house is quietly asking dozens of tracking and ad servers for permission to load something.

Every phone, smart TV and laptop in your house is quietly asking dozens of tracking and ad servers for permission to load something. A Pi-hole setup answers those requests for the whole network at once, so you block ads and trackers on devices where you could never install an extension, like the TV in the living room or the kids' tablets.
This guide walks through a Pi-hole setup on a small Linux box or Raspberry Pi, how to point your router at it, which blocklists are worth adding, and the mistakes that make families hate it within a week. Plan on about 45 minutes, plus a few days of tuning.
What a Pi-hole setup actually does on your network
Pi-hole is a DNS server with a filter in front of it. When a device asks for the address of an ad server, Pi-hole checks the name against its blocklists. If the name is listed, it replies with 0.0.0.0 and the ad never loads. If the name is clean, Pi-hole forwards the question to an upstream resolver and caches the answer.
That design has two consequences worth knowing before you start:
- It blocks by domain name, not by page content. Ads served from the same domain as the video, which is how YouTube works, will still play.
- It sees every DNS lookup on the network. That is useful for spotting a chatty smart plug, and it is also a privacy responsibility if other people live with you.
On a typical home network, expect 10 to 25 percent of all DNS queries to be blocked. A smart TV alone can account for thousands of blocked lookups per day.
Hardware and install for a home server
Pi-hole needs very little. A Raspberry Pi 3B or newer, an old mini PC, or a small virtual machine with 512 MB of RAM and 2 GB of disk is plenty for a household of 30 devices. If you already run a home server, a container is fine too, and a Docker Compose file keeps it tidy.
A Pi 4 idles at around 3 watts, which works out to a few dollars of electricity a year.
Step by step install
- Install a minimal OS such as Raspberry Pi OS Lite or Debian 12 and update it.
- Give the machine a fixed IP address. A DHCP reservation in the router is the cleanest way, for example 192.168.1.53.
- Download the official one line installer from the Pi-hole project and run it with bash. Reading the script before you run it is a good habit.
- Pick an upstream DNS provider when asked. Any well known public resolver works; you can change it later.
- Keep the web admin interface and query logging enabled for now. You will need the logs during the first week.
- Note the admin password the installer prints, then change it with pihole setpassword.
Turn on automatic OS security updates while you are there. On Debian based systems the unattended-upgrades package handles this in about five minutes.
Pointing the router at Pi-hole
Installing Pi-hole does nothing until devices actually use it. There are two common ways to make that happen.
| Method | How it works | Best for |
|---|---|---|
| Router DHCP DNS setting | The router hands out the Pi-hole IP as the DNS server to every device | Most home routers that allow a custom DNS field |
| Pi-hole as DHCP server | You turn off DHCP on the router and let Pi-hole assign addresses | ISP routers that lock the DNS setting |
| Per device setting | You type the Pi-hole IP into each device manually | Testing on one laptop before going network wide |
Avoid the setting some routers offer called "DNS on the WAN side". That only changes what the router itself uses, and every device will show up in Pi-hole as the router's single IP, which makes the logs useless.
After the change, devices pick up the new DNS server when their DHCP lease renews. Reconnecting to Wi-Fi forces it. Check the Pi-hole dashboard: client count should climb within an hour.
Blocklists and why more is not better
Here is the advice I disagree with most: the forum posts that tell you to load 40 blocklists with five million domains. It sounds thorough. In practice, giant stacked lists catch login domains, shopping checkout pages, email tracking links people actually click, and smart home cloud endpoints. You end up spending your evenings whitelisting things for annoyed housemates.
The default list that ships with Pi-hole blocks roughly 100,000 to 150,000 domains and catches most of what matters. Add one or two well maintained lists that focus on tracking and malware, then stop. A list should earn its place by blocking things the default does not, without breaking things you use. If a new list causes more than one complaint in its first week, remove it.
Allowlist entries you will probably need
- Link tracking domains used by your bank or shop emails, if people click those links.
- Microsoft and Apple update or account endpoints if a large list catches them.
- Streaming app domains that some lists wrongly flag as telemetry.
Use the Query Log, filter by the device that broke, and look for red blocked entries at the moment the problem happened. That takes about two minutes per fix once you know where to look.
Keeping it reliable for the whole household
When Pi-hole goes down, the internet looks broken for everyone. Plan for that.
- Run two instances if you can. A second Pi or a small VM, with both IPs handed out by DHCP, means one can reboot without anyone noticing.
- Do not set a public resolver as the secondary DNS alongside one Pi-hole. Devices will use it freely and skip the filter.
- Back up the config with the Teleporter export in the admin panel, and include it in your normal backups. Our Restic backup guide covers scheduling that.
- Keep the admin page off the internet. If you need it remotely, reach it through a VPN such as the setup in our WireGuard home server guide.
Also be honest with the people you live with. Tell them Pi-hole exists, show them how to pause it for five minutes from the dashboard, and consider shortening log retention to a day or two if privacy matters in your house.
Testing that blocking works
On a laptop using the new DNS, pick a blocked domain from the Query Log and run nslookup against it. If the answer is 0.0.0.0 and the server shown is your Pi-hole IP, filtering works. Then open a news site you know is heavy on ads and compare it with a phone on mobile data. The difference is usually obvious in page load time as well as clutter.
For more home lab projects, browse our self hosting articles.
Frequently asked questions
Does Pi-hole block YouTube ads?
Mostly no. YouTube serves ads from the same domains as the videos, so blocking them by DNS would break video playback. Pi-hole still blocks a lot of the tracking around YouTube, but you need a browser extension or a paid plan to remove the ads themselves.
Will Pi-hole slow down my internet?
On a working setup it usually speeds browsing up slightly. Cached DNS answers come back in under a millisecond on the local network, and pages load fewer third party scripts. Slowdowns almost always come from a single overloaded Pi or a bad upstream resolver.
Can Pi-hole run on the same server as other services?
Yes, as long as nothing else uses port 53 or the web port it needs. Running it in a container makes this easy. Just remember that if that server reboots for updates, DNS drops for everyone, which is a good argument for a second instance.
More in Self Hosting
Self Hosting
Dynamic DNS Setup to Reach Your Home Server by Name
The server at home is fine. The router is fine. What broke is the sentence you memorised two months ago, the one with four...
Self Hosting
Minecraft Server on a Mini PC: RAM, Flags and Backups
The server my friends play on is a fanless Intel N100 mini PC that cost $155, sits on a shelf behind the router, and has been...
Self Hosting
Updating Self Hosted Containers Without Breaking Them
Nothing on the server is broken, which is exactly why the Nextcloud container on mine spent fourteen months running an image I...