Pihole Setup Guide: Hardware, Install and Upkeep
Set up Pi-hole to block ads and trackers across every device, including smart TVs, with clear steps for routing traffic, testing, and upkeep.

tl;dr the short answer
Pi-hole is a DNS filter that blocks requests to many ad and tracker domains for devices using it, including smart TVs and other devices without ad-blocking apps. Setup means installing it on an always-on host, giving it a fixed IP address, and directing your router’s DNS settings to it; then verify devices appear in its query log and maintain blocklists and backups. It reduces many ads and trackers across your network, but cannot block every ad or stop apps and browsers that bypass its DNS.
Think of a front desk that checks every visitor against a list before letting them upstairs. Your home network works the same way. Each device asks a Domain Name System (DNS) server, the internet’s phone book, where every website lives.
Pi-hole is a small program that sits at that front desk. It refuses to look up ad and tracker names, so every device on your network gets the block, even the smart TV you can’t install software on.
In this guide, we’ll cover everything from hardware to v6 maintenance, so let’s get it running.
How Pi-hole Works Before You Setup Pihole
Before you configure anything, know how Pi-hole works and where it stops.
How DNS filtering blocks ads everywhere
Each time a device loads a site or app, it asks a DNS (Domain Name System) server for an address. Pi-hole answers those lookups for your whole network, so network-level DNS filtering covers devices without ad blockers.
Pi-hole checks its blocklist before anything goes upstream to the DNS server it normally uses. Blocked domains return 0.0.0.0, an address that goes nowhere, so the ad never loads. That’s the whole trick.
Where Pi-hole falls short
Pi-hole sees names, not content, so it has limits:
- Same-domain ads. Ads served from your video’s domain can’t be blocked without blocking the video too.
- Not a firewall. It filters lookups, not the traffic that follows.
- Hard-coded DNS. Apps with built-in DNS servers skip your network.
- VPN and browser DoH. A VPN (virtual private network) or DoH (DNS over HTTPS) can send lookups elsewhere, so Pi-hole never sees them.
- Phishing. Pi-hole isn’t effective here, since phishing sites often use fresh domains missing from blocklists.
- Router and DNS alternatives. Some routers and hosted services filter too, but Pi-hole gives you control over the lists.
Is setting up a Pi-hole worth it?
Yes, for many people, especially if you want one switch for the whole network. Here’s where the payoff shows up:
- Privacy from ISP logging. Your ISP (internet service provider) sees lookups by default. Pi-hole puts you in control.
- Fewer ads and trackers. Blocked domains stop loading on every device.
- Less distraction, safer for kids. Fewer pop-ups, and one filter for the whole house.
Think of a homelab Linux user who wants ads gone from the living room TV and a sibling’s tablet. One router change covers both.
Is Pi-hole still relevant in 2026? Yes, because plenty of ads and trackers still load from their own domains. Are pi holes illegal?
Filtering your own devices is about your own traffic, but this guide’s sources don’t cover the law, so check local rules for shared networks.
What changed in Pi-hole v6
Version 6 changed the plumbing, so older tutorials can steer you wrong.
- Built-in web server. According to Linuxize’s Ubuntu install guide, “Pi-hole v6 includes its own web server in the
pihole-FTLservice.” - No lighttpd or PHP. You don’t need lighttpd (a standalone web server) or PHP (a scripting language).
- Single TOML config file. Settings live in one TOML (a plain-text configuration format) file.
- REST API included. A REST API (web addresses other programs can call) comes built in.
What You Need Before You Start
Pi-hole answers Domain Name System (DNS) lookups, the service that turns site names into addresses, for your whole network. Sort out the hardware, the address, and the firewall first, and the install goes smoothly.
Minimum RAM, disk space and ports
The Pi-hole Hardware Requirements guide lists 512 MB of random access memory (RAM) as the minimum and 2 GB of free disk space, with 4 GB recommended.
Stick with a maintained, supported operating system (OS), like the Raspberry Pi OS Lite or Ubuntu setups we cover below. You also need ports 53 (DNS), 80, and 443 free on the host.
Is a Raspberry Pi 4 overkill?
Any Raspberry Pi works, and this guide suggests the Zero 2 W. For Pi-hole alone, a Pi 4 is usually overkill, given the 512 MB minimum. The real question is less about which board you own and more about how it’s powered and connected.
Spend a little on a solid power supply and microSD card. Keep the host always on, since Pi-hole is your DNS. When the host sleeps, every device using it loses lookups. Your DNS is asleep. Docker, a virtual machine (VM), or an old PC works too.
Preparing the OS and connecting over SSH
Start with Raspberry Pi OS Lite, the version without a desktop. Raspberry Pi Imager can set your hostname, Wi-Fi, and Secure Shell (SSH) access before first boot. Then connect with ssh <user>@<pi-ip> and run:
sudo apt update && sudo apt upgrade -ysudo reboot
On Ubuntu, install the prerequisites and tools before going further.

Keeping your Pi’s IP address fixed
Routers usually hand out addresses through Dynamic Host Configuration Protocol (DHCP), and those can shift. Pi-hole needs the same Internet Protocol (IP) address every time, so pick one fix:
- DHCP reservation: in your router, pin the Pi’s media access control (MAC) address to one IP.
- Static IP: set a fixed address on the Pi itself.
Do this before installing. Run ip a to see both values: the IP follows inet, and the MAC follows link/ether. Picture a homelabber whose family relies on the Pi for DNS.
If its address shifts after a power cut, the house loses internet until someone tracks it down. Set it once and forget it.
Firewall rules and port 53 conflicts
Use Uncomplicated Firewall (UFW) to accept traffic only from your local subnet, your home network’s address range:
sudo ufw allow from 192.168.1.0/24 to any port 53sudo ufw allow from 192.168.1.0/24 to any port 80,443 proto tcp
Swap in your own subnet, and allow SSH from it before enabling UFW so you don’t lock yourself out. Check for conflicts with sudo ss -tulpn | grep :53. On Ubuntu, systemd-resolved, the built-in DNS helper, often holds port 53 through a stub listener.
Set DNSStubListener=no in /etc/systemd/resolved.conf and restart the service.
Never expose these ports publicly. The IoT security study on Raspberry Pi 5 ran port scans against service ports 22, 80, 443, and 53, which is how open services get found.
Installing Pi-hole Step by Step
The install is quick, but the wizard choices and admin password are what you’ll live with.
Running the installer the safe way
The fastest route is the one-line curl install, which runs the installer in a single step. It’s convenient, but it means running code you haven’t read. Read it first: download the script, review it, and only then run it.
A git clone of the project gets you the same installer if you prefer version control. Either way, the official guide is your reference.
What to pick in the installer wizard
The wizard’s choices shape how your network uses Pi-hole:
- Network interface: pick the one connected to your router so Pi-hole sees your devices’ traffic.
- Upstream DNS (domain name) provider: Pi-hole still needs somewhere to send lookups it doesn’t block, so pick one you trust.
- Default StevenBlack blocklist: keep it for now. It’s a solid starting point, and you can add more later.
- Query logging: enable it so the dashboard shows what’s been blocked.
- Privacy level: pick the one you’re comfortable with, since it decides how much your logs reveal.
Setting your admin password and dashboard
The installer ends with a generated password on the final screen. Copy it somewhere safe, since it’s your dashboard key.
Run pihole setpassword on its own and let it prompt you, rather than typing the password into the command. Type it there and it lands in your shell history, where it doesn’t belong.
The dashboard lives at /admin on your Pi’s address, such as http://<your-pi-ip>/admin. If that page won’t load, try port 8080 instead: http://<your-pi-ip>:8080/admin.
Think of a homelabber who keeps the Pi in a closet and checks blocked queries from the couch. With the password saved and /admin bookmarked, they’re in seconds. No terminal required.
Sending Network Traffic Through Pi-hole
Pi-hole can only block the queries it sees, so the goal is getting every device to ask it first. We’ll start with your router, then patch the gaps.
Pointing your router’s DNS at Pi-hole
The simplest whole-network fix is your router. In its LAN or DHCP settings, set the Domain Name System (DNS) server to Pi-hole’s static address, such as 192.168.1.10.
Use the LAN settings, not the WAN (internet) DNS field, which only affects the router’s own lookups.
Renew leases afterwards. Devices keep their old DNS until their Dynamic Host Configuration Protocol (DHCP) lease renews, so reconnect to Wi-Fi or bounce the connection.
Think of a Fedora user on a ten-year-old ThinkPad who changes the router, then wonders why the laptop still uses the ISP’s resolver. One reconnect fixes it, and its queries finally show up in Pi-hole’s log.
Letting Pi-hole handle DHCP instead
If your router won’t let you change its DNS, let Pi-hole act as the DHCP server instead. Treat this as a fallback, since two DHCP servers on one network cause conflicts. First, turn off DHCP on your router.
Then, in the Pi-hole web interface, go to Settings > DHCP, enable it, and fill in your address range and gateway.
Setting DNS on individual devices
For a single machine, set DNS by hand. On Linux with NetworkManager, the nmcli tool does it from the terminal:
nmcli connection modify "Wired connection 1" ipv4.dns "192.168.1.10" ipv4.ignore-auto-dns yes
nmcli connection up "Wired connection 1"
Swap in your own connection name (nmcli connection show lists them). The second setting stops DHCP from adding the router’s DNS back in.
Treat this as a testing tool, not a permanent plan: every device needs its own change, and it only works while Pi-hole keeps the same address. Give Pi-hole a static IP or DHCP reservation first.

Stopping devices from skipping the filter
Some devices still find their way around Pi-hole. Watch for these:
- Public backup DNS. A secondary public resolver can skip Pi-hole entirely. Remove it.
- A single point of failure. If your only Pi-hole goes down, nothing resolves. Run a second one and hand out both addresses.
- IPv6 advertisements. Routers can push their own Internet Protocol version 6 (IPv6) DNS, bypassing your IPv4 setting. Point that at Pi-hole too.
- VLANs. Virtual LANs (VLANs) split one network into segments, and Pi-hole may ignore segments it isn’t attached to. Adjust its listening mode, but only on networks you trust.
Forcing all DNS traffic through Pi-hole
Some devices ignore your DNS settings. Smart TVs and plenty of gadgets have hard-coded DNS, a server address built into the firmware. Setting DNS asks devices nicely, but a redirect forces the issue.
On OpenWrt, that’s a firewall redirect that catches outbound port 53, the standard DNS port:
config redirect
option name 'Force-DNS-to-Pi-hole'
option src 'lan'
option src_dport '53'
option dest_ip '192.168.1.10'
option dest_port '53'
option proto 'tcp udp'
option target 'DNAT'
Make sure the rule can’t catch Pi-hole’s own upstream lookups, or they’ll loop back to it. This is the riskiest option. Encrypted DNS on other ports slips past, and forced redirects can break devices that expected their own resolver.
Checking That Pi-hole Is Working
Pi-hole can look healthy on its dashboard while one device skips it, so check both ends.
Testing DNS from the command line
Ask Pi-hole directly with dig, a lookup tool that lets you name the server: dig @192.168.1.10 <blocked-domain>. A blocked domain should return 0.0.0.0, not a real address. Run pihole status on the Pi to confirm blocking is on.
On your Linux client, resolvectl status lists the DNS server each interface uses. Seeing your Pi’s address there means the device really asks Pi-hole. Repeat the query with drill, a similar tool. If dig and drill agree, the answer holds.
A student on a ten-year-old ThinkPad points the laptop at a Pi in the closet. One dig returns 0.0.0.0, so they can stop wondering whether the Pi is the problem.
Reading the dashboard and query log
Open the dashboard and find the query log, the running list of lookups Pi-hole handled. Confirm your client appears there, since a missing device isn’t using Pi-hole.
Check that the blocked query percentage is above zero, and watch the client column while you browse. Finally, type pi.hole into a browser. If the dashboard loads, local DNS resolves that name.
Testing ads in your browser
Run the Adblock Tester site, then visit a few ad-heavy sites you use daily. Ads still showing are a clue, not a verdict. A common culprit is DNS over HTTPS (DoH), which sends lookups straight to a resolver the browser picks, skipping Pi-hole.
Turn DoH off in your browser’s network settings. Then retest. Firefox also checks a canary domain before using its own DoH, and blocking that domain on Pi-hole can nudge it back to your normal DNS.
Managing Blocklists, Allowlists and Groups
Lists need upkeep, broken sites need exceptions, and some devices need their own rules. Here’s how we handle each.
Adding and updating your blocklists
Start with the default list, which is enough to get going. To add more, open the Lists page, paste in each list’s address, and save. Add extra sources one at a time, so you can tell which one caused trouble.
The goal isn’t more lists. It’s current ones. After any change, rebuild gravity, the compiled database Pi-hole blocks from, with pihole -g in the terminal.
Fixing sites broken by blocking
Open the query log when a site won’t load, then filter for the device having trouble and find the domain marked as blocked.
Think of a homelab tinkerer whose streaming app spins forever on the living room TV. They find the blocked domain in the log, add it to the allowlist (the domains Pi-hole always lets through), and the app loads on the next launch.
Allow only the domains you actually need. Common allowlist sources for popular services can save you digging, but add only the domains they name. Allowing one domain beats turning blocking off for the whole network. Usually, that’s all it takes.
Grouping devices with different rules
Groups let different devices follow different rules. You’ll mostly use three:
- Default: your standard blocking rules.
- Bypass: devices here skip blocking.
- No-internet: devices here lose internet access.
Consider a self-hoster whose guests keep asking for the Wi-Fi password. Their phones go in the bypass group, so visitors browse freely while the kids’ tablets stay in Default. Your own settings don’t change at all.
The group management docs cover the full setup.
Keeping Pi-hole Running Smoothly
Once Pi-hole is blocking, keeping it healthy is mostly routine. A few commands and settings keep it reliable and your logs private.
Updating Pi-hole and refreshing lists
Run pihole -up to update Pi-hole’s components. Back up with Teleporter, Pi-hole’s built-in backup tool, before you update. Once you trust your routine, automate weekly updates.
Refresh your blocklists with pihole -g. Think of a tinkerer who runs pihole -g right after updating, so every device starts the week on fresh rules.

Everyday commands you will use
A few commands cover most daily needs:
- Temporarily disable blocking:
pihole disablepauses filtering while you test a site that misbehaves. - Enable blocking again:
pihole enableswitches filtering back on. - Tail the live query log:
pihole -tshows each lookup as it happens.
Pausing is handy, but blocking stays off until you flip it back. It’s easy to forget.
Keeping it reliable and your logs private
Pi-hole is a single point of failure for your network. If it goes down, every device loses DNS (the Domain Name System, which turns names into addresses), so the internet looks broken even when your connection is fine.
Your query log is sensitive because it shows who asked for what. Picture a student in a shared apartment: anyone who can open that log sees every site each laptop looked up, so lock down the web interface.
Keep the clock right with NTP (Network Time Protocol) so log timestamps line up when you troubleshoot.
Then give the Pi-hole and your main devices static leases, fixed addresses from your router’s DHCP (Dynamic Host Configuration Protocol, the service that hands out addresses), so their addresses never shift.
When Things Go Wrong
Most Pi-hole problems aren’t really about Pi-hole itself. They’re about where your devices send their lookups, so we’ll trace that path before you rebuild anything. Start there.
Problems you are most likely to hit
- Port 53 conflicts. Pi-hole needs port 53, the DNS (Domain Name System) port, and another service may already hold it. On many Linux systems,
systemd-resolvedis the usual suspect. Runsudo ss -tulpn | grep :53to see who’s listening. - Admin page not opening. Check that you’re typing the Pi’s address into the browser and that the service is running.
systemctl status pihole-FTLshows that at a glance. - Clients still see ads. Usually the device isn’t asking the Pi at all. Look for hardcoded DNS servers or a browser’s encrypted DNS setting, which can bypass the Pi.
- Query timeouts from VLANs or guest Wi-Fi. Separate virtual networks (VLANs) may not reach the Pi, so lookups hang. Consider a self-hoster whose kids’ tablet stalls on guest Wi-Fi while the laptop works fine. Let that network reach the Pi, and the tablet loads as fast as the laptop.
- Blocklist download failures. Pi-hole builds its blocklists in a gravity update (the download-and-merge step). If one list won’t fetch, run
pihole -gby hand and read the output to find it.
Quick fixes to try first
- Restart your router and renew leases. Reboot the router, then reconnect your clients so they request a fresh lease from DHCP (Dynamic Host Configuration Protocol). That points them at the Pi.
- Check client DNS settings. Confirm the device points at the Pi. On Linux,
resolvectl statusshows which DNS server is in use. - Check logs and service status.
systemctl status pihole-FTLconfirms it’s running, andjournalctl -u pihole-FTL -n 50prints the latest log lines.
Advanced Options for Power Users
These options cover where your DNS (Domain Name System) queries go, how you reach Pi-hole away from home, and how you manage it.
Choosing your upstream DNS resolver
Pi-hole sends unblocked queries to an upstream resolver, the server that does the actual lookup. Your main options:
- Public resolver forwarding: Point Pi-hole at a public DNS provider. Simplest, but that provider sees every lookup.
- Recursive resolution with unbound: Let unbound, a resolver you control, query authoritative servers directly. More privacy, a bit more setup.
- DNSSEC validation check: DNSSEC (DNS Security Extensions) lets resolvers confirm answers are authentic. Check that validation is switched on.
Reaching Pi-hole from anywhere
Picture a Linux user with a laptop at a coffee shop. With Tailscale, a private VPN (virtual private network), that laptop still routes lookups through the Pi-hole at home, so ads stay blocked on the road.
Set Pi-hole to respond on all interfaces so it answers over that link too. Tailscale changes where your lookups go, not whether they get filtered. Same blocklists, new route.
Editing config files and using the API
Settings live in pihole.toml, a plain-text file in the TOML (Tom’s Obvious, Minimal Language) format. Edit it by hand or use the pihole-FTL --config command-line interface (CLI).
Pi-hole also exposes a REST API (representational state transfer application programming interface), a set of web addresses other programs can call. It’s self-documenting, so you don’t need outside docs to learn what each address does.
Consider a tinkerer who rebuilds their Pi-hole after every fresh install. A short script that runs pihole-FTL --config to restore their settings turns an afternoon of clicking into one command. Your setup, saved as code.
Once Pi-hole is running, it does its job quietly in the background, and you only need to check on it now and then. Keep the habits from this guide close: verify after every change, keep your blocklists tidy, and back up your config before you update.
A small, working setup beats a huge, broken one every time. Your network, your rules.
References
- A COMPREHENSIVE EDGE-BASED SECURITY MONITORING FRAMEWORK FOR IOT NETWORKS USING RASPBERRY PI 5 — doi.org (2026)
- Pi-hole Hardware Requirements: RAM, Storage and Pi Models — piholehq.com (2026)
- How to Install Pi-hole on Ubuntu: Network-Wide Ad Blocker — linuxize.com (2026)
Questions
Is Pi-hole still relevant in 2026?
Yes. Pi-hole remains relevant in 2026 because many ads and trackers still use separate domains that DNS filtering can block across a home network. It does not block every ad, especially ads served from the same domain as the content.
Is setting up a Pi-hole worth it?
For many people, yes. Pi-hole can reduce ads and tracking across devices, including smart TVs, with one network setting, and it gives you control over blocklists. It requires an always-on host and some maintenance, and it cannot block every ad or prevent all tracking.
Are pi holes illegal?
Using Pi-hole to filter DNS for your own devices is generally not illegal. Rules can vary for shared, workplace, or public networks, so check local laws and any network policies before filtering traffic for other users.
Is Raspberry Pi 4 overkill for Pi-hole?
For Pi-hole alone, a Raspberry Pi 4 is usually more powerful than necessary. The stated minimum is 512 MB of RAM, and a smaller board can be sufficient; reliable power and a stable network connection matter more. A Pi 4 can still make sense if you already own one or plan to run other services on it.


