A DNS filter answers name lookups (such as example.com) for the whole network and refuses those for advertising, tracking or malware domains. It works on every device, including smart TVs and plugs where you cannot install an ad blocker. The two most popular self-hosted options are AdGuard Home and Pi-hole, both free and open source.
Comparison
| AdGuard Home | Pi-hole | |
|---|---|---|
| Licence | GPLv3 | EUPL |
| Installation | A single binary for Linux, Windows, macOS; also Docker and a Home Assistant add-on | Installer script for Linux (Raspberry Pi OS, Debian, Ubuntu and others), Docker |
| Encrypted upstream DNS (DoH, DoT) | Built in, DNS-over-QUIC too | Through add-ons (for example cloudflared or a resolver such as Unbound) |
| Encrypted DNS for home devices | Can act as a DoH and DoT server (needs a certificate) | Not native |
| Per-device settings | Yes, rules and blocked services per client | Yes, through groups |
| Safe search and parental control | Built in | Through lists or rules |
| Built-in DHCP | Yes | Yes |
| Community and guides | Large | Very large, many guides |
In short: AdGuard Home is handier if you want encrypted DNS and per-device rules without add-ons; Pi-hole suits a modular setup, often paired with Unbound as a recursive resolver. Both run happily on a Raspberry Pi or mini PC: see mini PC or Raspberry Pi 5.
Installing and connecting it to the network
- Give the device a fixed IP address (a DHCP reservation on the router).
- Install the software and open the web interface for the initial setup.
- Choose the upstream servers that receive non-blocked queries, preferably encrypted (DoH or DoT).
- On the router, hand out the filter’s address as DNS to all devices, in both IPv4 and IPv6. If the router advertises a different IPv6 DNS server, many devices bypass the filter: see IPv6 at home.
- Check the query log to confirm that every device is sending queries.
Blocklists: less is more
- Start with one or two curated lists (the program’s defaults) and add more only if needed.
- Huge, aggressive lists cause false positives: sites that fail to load, banking apps that break, email links that will not open.
- Update lists automatically, for example once a day.
A real case: when the filter blocks services you use
It happened on this site: a Google plugin for WordPress showed cURL error 7 for adsense.googleapis.com. The cause was the home DNS filter answering 0.0.0.0 for some Google domains used both for advertising and for management dashboards. The fix was an exception rule for those domains:
# AdGuard Home, custom rules
@@||adsense.googleapis.com^$important
@@||analyticsdata.googleapis.com^$important
In Pi-hole you get the same result by adding the domains to the allowlist. Before adding an exception, check in the query log which domain was blocked and by which list, and allow only that one.
Devices that bypass the filter
- Browser secure DNS and Android Private DNS: when on, they send queries straight to an external encrypted server.
- Some devices have hard-coded DNS servers. If your router allows it, redirect port 53 traffic to the filter or block it.
- A VPN on the device usually uses its own DNS.
A DNS filter is not an antivirus or a firewall: it lowers the risk but does not replace updates and strong passwords.
Reliability
- If the filter goes down, “the Internet stops working” at home. Consider a second instance on another device and advertise both.
- Back up the configuration after every significant change.
- To spot outages immediately you can monitor it with Uptime Kuma, which has a DNS check.
Sources
- AdGuard, AdGuard Home wiki and filtering rule syntax.
- Pi-hole, official documentation.
- NLnet Labs, Unbound documentation.
