The Homelab Bench is reader-supported. As an Amazon Associate we earn from qualifying purchases; this article contains affiliate links.
By the end of this guide you will have a Raspberry Pi running either Pi-hole or AdGuard Home as a network-wide DNS ad-blocker — blocking ads, trackers, and malicious domains for every device on your home network without touching a single app. You will also know how to point your router at it so everything benefits automatically, and how to add or remove blocked domains through the web dashboard.
Checked against Pi-hole v6, AdGuard Home v0.107 and Raspberry Pi Imager 2 in November 2026. The AdGuard Home screenshots are from the instance that runs DNS for our own homelab.
Prefer to watch? Here is the full walkthrough on video:
What Problem Does This Actually Solve?
When any device on your network — a phone, a smart TV, a Zigbee hub — makes a DNS lookup for an ad or tracking domain, your Pi intercepts that query and refuses to give it a real answer. The ad never loads. Because it works at the DNS layer, it covers apps, games, and smart-home devices that browser extensions can never touch. It also keeps everything local: no cloud account, no subscription, no data leaving your house.
If you run Home Assistant and are thinking about VLANs to separate IoT gear from trusted devices, a Pi-hole or AdGuard Home instance fits neatly into that setup — see our IoT VLAN separation guide for how to route DNS queries from each VLAN through the same Pi without letting those devices talk to each other. And if you want remote access so the blocker works when you’re off-site, our Tailscale/WireGuard remote access guide covers that side of things.
Pi-hole or AdGuard Home — Pick One
Both are free, open-source, and excellent. Here is what actually differs between them so you can decide before you start:
| Feature | Pi-hole v6 | AdGuard Home |
|---|---|---|
| Encrypted upstream DNS (DoH/DoT/DoQ) | Not built in — needs a helper running alongside it, such as dnscrypt-proxy for DNS-over-HTTPS. The old cloudflared method no longer works: Cloudflare removed proxy-dns from new cloudflared releases from February 2026. |
Built-in, works out of the box |
| Web UI | Redesigned in v6; Basic and Expert modes | More modern single interface |
| Community & guides | Very large; decade of forum posts | Smaller but growing |
| Per-client rules | Groups system | Per-client settings; slightly simpler |
| DHCP server | Full dnsmasq-backed | Built-in (not supported on Windows hosts) |
| Configuration file | Single TOML at /etc/pihole/pihole.toml | Single YAML |
Short version: choose AdGuard Home if you want encrypted DNS to upstream resolvers without extra setup steps. Choose Pi-hole if you want the deepest library of community guides and are happy to add a helper such as dnscrypt-proxy later if you want encryption. This guide covers both — follow the section that matches your choice.
What You Need
- A Raspberry Pi — any model with at least 512 MB of RAM and 2 GB of free storage. A Pi 4 or Pi 5 is ideal if you plan to run other services on the same board. A Pi Zero 2 W can handle DNS duty on its own, but it has no Ethernet port, so add a USB Ethernet adapter.
- A microSD card — 16 GB is enough, 32 GB gives comfortable headroom.
- A power supply rated for your Pi model.
- An Ethernet cable — a DNS server on Wi-Fi is asking for reliability problems. Wire it in.
- A computer to flash the SD card and SSH from.
- Your router’s admin page login details.
Check price: Amazon UK | Amazon US | Amazon IE
Check price: Amazon UK | Amazon US | Amazon IE
Check price: Amazon UK | Amazon US | Amazon IE
Step 1 — Flash Raspberry Pi OS Lite and Enable SSH
We use the headless Lite image because a desktop GUI wastes RAM and there is nothing to gain from it here. If this is your first time setting up a Pi at all, our Raspberry Pi setup from scratch guide walks you through Imager screen by screen — come back here once you have SSH access.
Raspberry Pi Imager 2 is a step-by-step wizard (Device, OS, Storage, Customisation, Writing):
- Download and open Raspberry Pi Imager on your computer (free from raspberrypi.com).
- Device: pick your Pi model.
- OS: choose Raspberry Pi OS (other) → Raspberry Pi OS Lite (64-bit) — no desktop, 64-bit kernel.
- Storage: select your microSD card. Double-check the size so you don’t wipe the wrong drive.
- Customisation: set a hostname (e.g.
piholeoradguard), your time zone and keyboard, and a username and password. Skip Wi-Fi — you will use Ethernet. On the Remote access step, turn on SSH with password authentication (or paste your public key if you have one). - Writing: confirm, and Imager will flash and verify the card.
- Insert the card into the Pi, plug in Ethernet, then plug in power. Wait about 60 seconds for first boot.
Step 2 — SSH In and Update the System
Find the Pi’s IP address in your router’s DHCP client list (look for the hostname you set). Then open a terminal on your computer:
ssh [email protected]
Replace pi with the username you chose in Imager, and 192.168.1.X with the actual IP. Accept the fingerprint, enter your password. Now update the system:
sudo apt update && sudo apt full-upgrade -y
This may take a few minutes. Reboot once it finishes:
sudo reboot
SSH back in after about 30 seconds.
Step 3 — Give the Pi a Fixed IP Address
A DNS server must always be reachable at the same address. The cleanest way to do this is a DHCP reservation on your router — you tell the router to always hand the Pi the same IP based on its MAC address. This is safer than setting a static IP directly on the Pi, because a misconfiguration on the Pi can lock you out of the network entirely.
- Log into your router’s admin page (usually
192.168.1.1or192.168.0.1). - Find the DHCP or LAN settings and look for a section called DHCP Reservations, Static Leases, or Address Reservation (the name varies by router brand).
- Find the Pi in the current client list and reserve an address for it, something easy to remember like
192.168.1.5. Some routers want reserved addresses inside the DHCP range and some outside it — the reservation page usually says which. - Save, then reboot the Pi (
sudo reboot) so it picks up the reserved address. SSH back in at the new address to confirm it works.
Write that IP address down. You will use it in every step that follows.
Option A: Installing Pi-hole
Skip to Option B if you chose AdGuard Home.
A1 — Run the Installer
Pi-hole’s official one-line installer handles everything — dependencies, the DNS engine (called FTL), and the admin panel, which FTL now serves itself in v6 (no separate web server to install):
curl -sSL https://install.pi-hole.net | bash
The installer is interactive. After the welcome screens, here is what it asks you:
- Static IP needed — choose Continue. You have already sorted this with the router reservation.
- Upstream DNS provider — this is where your allowed (non-blocked) DNS queries will go. Cloudflare, Quad9 or Google are all fine as a starting point. You can change this later.
- Enable logging — say yes. The dashboard is much more useful with query logging on.
- Privacy mode for FTL — leave it at 0 (Show everything) for a home network. This only controls how much detail appears in the statistics.
- Blocklists — say yes to the default list (StevenBlack’s Unified Hosts List). You can add more after installation.
When the installer finishes, it shows you the Pi’s IP, the admin URL, and a randomly generated admin password. Copy that password now and save it in a password manager. Pi-hole has no username, just that password. If you need to change it later, run sudo pihole setpassword on the Pi.
A2 — A Quick Tour of the Pi-hole v6 Dashboard
Open a browser on any device on your network and go to:
http://YOUR-PI-IP/admin
Log in with the password from the installer. Here is what you are looking at:
- Top bar tiles — Total Queries, Queries Blocked, Percentage Blocked, and Domains on Lists. These update in real time.
- Left sidebar — the main navigation. The sections you will use most are Query Log (live DNS requests from every device), Lists (your blocklists and allowlists), and Tools → Update Gravity (pulls fresh data from your blocklists).
- Settings — split into Basic and Expert modes in v6. Basic covers most of what a home network needs.
Pi-hole v6 also serves the admin interface over HTTPS on port 443 with a self-signed certificate. The browser security warning is expected on a local network — it just means the certificate wasn’t issued by a public authority.
A3 — Adding Blocklists
Pi-hole ships with a default blocklist that covers the basics. To expand it, go to Lists in the sidebar, paste a blocklist URL into the address field, and click Add blocklist. A solid starting point that most home users find well-balanced is the OISD Big list:
https://big.oisd.nl
After adding lists, you must rebuild Pi-hole’s internal database — this is called Update Gravity. Do it via Tools → Update Gravity in the sidebar, or over SSH:
pihole -g
Gravity runs automatically once a week, so after the initial manual run you generally do not need to trigger it yourself unless you change lists. Avoid adding dozens of overlapping lists — large duplicated lists make troubleshooting broken sites harder without meaningfully improving blocking.
A4 — Allowlisting a Broken Site
If a website or app stops working after you turn on Pi-hole, the query log will show you exactly which domain was blocked. Find the blocked domain in Query Log, click it, and choose Allow. From the command line the same thing is:
sudo pihole allow example.com
Note that the v6 command is pihole allow, not the old pihole -w from v5 — if you find older guides using v5 syntax, that is why they look different.
Option B: Installing AdGuard Home
Skip this section if you followed Option A.
B1 — Run the Installer
AdGuard Home’s official install script downloads the correct binary for your Pi’s architecture into /opt/AdGuardHome and registers it as a systemd service automatically:
curl -s -S -L https://raw.githubusercontent.com/AdguardTeam/AdGuardHome/master/scripts/install.sh | sh -s -- -v
The script will tell you when it finishes and confirm the service is running. AdGuard Home starts automatically on every boot from this point on — you do not need to do anything extra to make it persistent.
B2 — Complete the Setup Wizard
AdGuard Home’s first-run configuration happens entirely in the browser. On any device on your network, open:
http://YOUR-PI-IP:3000
You will see a five-step setup wizard. Here is what each step is doing:
- Welcome — click Get Started.
- Admin web interface & DNS server — the wizard suggests port 80 for the admin interface and port 53 for DNS. Keep both unless something else on the Pi already uses port 80 (then pick another free port, such as 8080). Click Next.
- Authentication — create your admin username and password here. AdGuard Home has no default credentials and will not let you proceed without setting them. Store them in a password manager.
- Configure your devices — this screen shows you the IP address to point devices at. Note it. Click Next.
- Finish — click Open Dashboard and log in with the credentials you just created.
Port 3000 is only for the wizard. From now on the dashboard lives at http://YOUR-PI-IP (plus :port if you changed it from 80).
B3 — A Quick Tour of the AdGuard Home Dashboard
After logging in you will land on the main dashboard. The key areas:
- Top statistics — DNS queries, blocked by filters, blocked malware/phishing, and blocked adult websites, plus top clients and top queried and blocked domains further down.
- Query Log (top navigation) — a live feed of every DNS request from every device, with the result (allowed or blocked) and which filter list caught it.
- Filters (top navigation) — this is where you add, remove, and update blocklists and your own rules. It is the equivalent of Pi-hole’s Lists and Update Gravity in one place.
- Settings → DNS settings — where you configure upstream DNS servers (including encrypted ones) and control caching.
- Settings → Client settings — AdGuard Home’s strong suit for beginners: you can name devices and give them their own rules without learning a groups system.
B4 — Configure Encrypted Upstream DNS
This is AdGuard Home’s headline advantage over Pi-hole for a beginner setup. Without encrypted DNS, your ISP can see every domain your devices look up. AdGuard Home supports DNS-over-HTTPS, DNS-over-TLS, and DNS-over-QUIC as upstream resolvers, all built into the same program with no extra daemon required.
Go to Settings → DNS settings. In the Upstream DNS servers box, replace whatever is there with encrypted alternatives, one per line. Some reliable examples:
https://dns.quad9.net/dns-query
tls://1.1.1.1
https://cloudflare-dns.com/dns-query

Below the examples you choose how AdGuard Home uses the list. The default, Load-balancing, sends each query to one server at a time and favours the fastest, most reliable one. Parallel requests asks every server at once and takes the first answer. Load-balancing is the right choice for most homes. Click Apply to save, and use Test upstreams to check they all answer.

B5 — Add Blocklists
Go to Filters → DNS blocklists → Add blocklist → Add a custom list. Give it a name and paste a URL. The same OISD Big list works well here too:
https://big.oisd.nl
Click Save. AdGuard Home downloads and applies the list immediately — there is no separate gravity update step. OISD Big is also in AdGuard Home’s built-in catalogue, so Add blocklist → Choose from the list gets you the same thing without copying a URL.

To allow a blocked domain, go to Filters → Custom filtering rules and add a line like:
@@||example.com^
That syntax tells AdGuard Home to pass all queries for example.com and its subdomains through without checking blocklists. Click Apply to save. The examples under the box cover the other rule types.

Step 4 — Point Your Router at the Pi
This is the step that makes the whole network benefit. Without it, only devices you configure manually will use your new DNS server.
- Log back into your router’s admin page.
- Find the DNS settings — this is usually inside DHCP settings, LAN settings, or Internet settings depending on your router brand.
- Set the Primary DNS to your Pi’s fixed IP address (the one you reserved in Step 3).
- Leave the Secondary DNS blank if your router allows it. If you put a public resolver like
9.9.9.9there, many devices will use it some of the time even while the Pi is healthy, so some ads get through. If you want a fallback, a second Pi running the same blocker is the clean way to do it. - Save and let the router push the new DNS setting to devices via DHCP. Devices that already have a lease may need to reconnect or renew — toggle Wi-Fi off and on, or wait for the lease to renew.
Some ISP routers don’t let you change the DNS server they hand out. If yours is one of them, turn off the router’s DHCP server and let Pi-hole or AdGuard Home do DHCP instead — both have a built-in DHCP server.
To test it is working, pick up your phone, open a browser, and visit the Pi-hole or AdGuard Home query log. Browse to a few websites. You should see DNS queries appearing in the log within seconds, with some marked as blocked.
Step 5 — Keeping Things Running
A few maintenance habits that will save you headaches:
- Update the Pi’s OS regularly:
sudo apt update && sudo apt full-upgrade -yonce a month is fine for a stable DNS box. - Update Pi-hole itself: the dashboard tells you when an update is available; run
pihole -upover SSH to install it. - Update AdGuard Home itself: when a new version is out, a banner appears across the top of the dashboard with an Update now button. AdGuard Home keeps a copy of the previous version and config in its
backupfolder. - Blocklists update automatically — Pi-hole runs gravity once a week; AdGuard Home refreshes its lists on the schedule set under Settings → General settings → Filter update interval (24 hours by default).
- Back up your config: for Pi-hole, the main config lives at
/etc/pihole/pihole.tomland the gravity database at/etc/pihole/gravity.db. For AdGuard Home, the config is at/opt/AdGuardHome/AdGuardHome.yaml. Copy these off the Pi periodically. If you’re already running Proxmox, our automated backup guide covers how to include LXC or VM snapshots in a scheduled backup job — running your DNS server in a container rather than directly on a Pi is worth considering once you’re more comfortable with the homelab stack.

Frequently Asked Questions
Will this break anything on my network?
The most common breakage is streaming services or apps that rely on ad-funded domains being reachable — you may find a specific video player or game stops working. The fix is always the same: check the query log, find the blocked domain, and allowlist it. Expect to do this a handful of times in the first week, then rarely after that. If the Pi goes offline, devices lose DNS until it comes back, so wire it in, give it a decent power supply, and consider a second Pi running the same blocker as a backup.
Can I run Pi-hole or AdGuard Home inside a Proxmox VM or LXC instead of on a Pi?
Absolutely — both install the same way on any Debian-based system, and that is how we run AdGuard Home ourselves: in an LXC container on our Proxmox host. You get snapshot backups and can clone the container as a template. See our LXC cloning and templating guide for how to set that up. If you don’t have a Proxmox server yet, our Proxmox VM setup guide is the starting point.
Do I need to do anything in Home Assistant to take advantage of this?
No. Once the router hands out the Pi as the DNS server, Home Assistant and your smart home devices use it automatically, so the telemetry and tracking domains they phone home to get blocked at the DNS level. If you want the numbers on a Home Assistant dashboard, both Pi-hole and AdGuard Home have official Home Assistant integrations that show query and block counts and add a switch to pause blocking. In the query log itself, give your devices friendly names (Client settings in AdGuard Home, Local DNS records in Pi-hole) so the log is easier to read.