A small Pi. A useful boundary.
HiveNet is what I call my Raspberry Pi running AdGuard Home. It filters DNS lookups for devices configured to use it. You’re building a DNS filter, not replacing the router.
Bring these
- A Raspberry Pi supported by your OS and AdGuard Home. My build uses a Pi 5; DNS filtering does not require a Pi 5.
- A reliable power supply, microSD card and Ethernet cable.
- A computer for Raspberry Pi Imager and SSH.
- Access to your router’s LAN/DHCP and IPv6 DNS settings.
Know the limits
- It can block domains on enabled filter lists.
- It cannot reliably separate ads from content on the same domain, including many video ads.
- Apps using their own DNS, a VPN or direct IP connections may bypass it.
- It doesn’t make you anonymous or stop tracking inside signed-in accounts.
Before changing household DNS, tell the people using the network. Photograph the existing router settings and download the rollback worksheet. Start on one device.
Make the examples yours
These values only change commands on this page. They are not sent anywhere or used to connect to your network.
Example values. Enter the address reserved by your router and the username you chose in Imager.
Give DNS a reliable home.
- Use Raspberry Pi Imager to install a supported Raspberry Pi OS Lite image. A 64-bit image suits a Pi 5. In OS customisation, set a username, a hostname such as
hivenet, and enable SSH with your public key. - Connect Ethernet and boot. Find the Pi in your router’s connected-device list, then reserve its address in DHCP. The example address on this page must be changed to fit your LAN.
- Connect and update the Pi. Apply any requested reboot before continuing.
ssh your-user@192.168.1.53sudo apt update
sudo apt full-upgrade
# If an upgrade requires a reboot:
sudo rebootDownload the official installer to a file so you can inspect it before running it. This requires administrator privileges and installs a service.
curl -fSL https://raw.githubusercontent.com/AdguardTeam/AdGuardHome/master/scripts/install.sh -o /tmp/adguardhome-install.sh
less /tmp/adguardhome-install.sh
# Press q to exit the reader. Run after reviewing the script:
sudo sh /tmp/adguardhome-install.sh -vOpen http://192.168.1.53:3000 from your LAN for first-run setup. Choose the LAN interface for DNS on port 53; choose an available admin web port and save its URL. Port 80 is an example, not a requirement. Create a strong admin password.
Keep DNS and the admin interface private to your LAN. Don’t forward ports 53, 80 or 3000 from the internet. If “address already in use” appears, identify the conflicting service before changing it; see troubleshooting.
Encrypt the next hop.
AdGuard Home asks an upstream resolver when it needs an answer that is not cached or blocked. In Settings → DNS settings, use this Quad9 DNS-over-HTTPS endpoint:
https://dns.quad9.net/dns-queryUse these bootstrap resolvers to look up the upstream’s hostname. Bootstrap DNS is usually unencrypted; it is not a second route for all client queries.
9.9.9.9
149.112.112.112Use the dashboard’s upstream test, then save. Leave fallback resolvers empty for this baseline so a failure doesn’t silently switch to an unreviewed resolver. Review your configured fallback and private reverse-DNS settings separately.
dns.mullvad.net and test the replacement. Mullvad’s notice.Quad9 is an independent service with its own filtering and privacy policies. DoH encrypts the Pi-to-resolver DNS connection; it does not encrypt all your traffic or prevent destination IP addresses and other metadata from being visible. The upstream still receives the lookups it answers.
Do I need two providers or parallel mode?
No. Start with one working service. Multiple upstreams can improve availability, but parallel mode shares queries with multiple resolvers and isn’t “zero latency.” Two upstreams also do not protect you from the Pi losing power. For local redundancy, use a second filtered resolver.
Can I edit AdGuardHome.yaml instead?
Prefer the dashboard. If editing the file, stop AdGuard Home first, back up the configuration, then restart after your changes. The running service can overwrite manual edits. Paths and service names depend on how you installed it.
Prove it on one device.
Run these from a computer on your LAN. On Debian/Ubuntu, sudo apt install dnsutils provides dig. On Windows, use nslookup example.com YOUR_PI_IP. A successful lookup proves DNS resolution, not complete privacy.
dig @192.168.1.53 example.com A
dig @192.168.1.53 example.com AAAAExpect: a reply without a timeout, with SERVER pointing to the Pi. Check that the request appears in AdGuard Home’s query log. Some valid names have no AAAA record; that alone is not a failure.
Test blocking with your own temporary rule
In Filters → Custom filtering rules, add the rule below. It uses a reserved test domain, so the test does not depend on a real ad domain staying on a list.
||hivenet-check.test^dig @192.168.1.53 hivenet-check.test AExpect: the query log says the request was blocked by your custom rule. Depending on blocking mode, the reply can be 0.0.0.0, NXDOMAIN, REFUSED, or another configured response. A DNS error by itself is not proof of blocking. Remove the temporary rule when finished.
Set just this computer’s DNS to the Pi, then test normal browsing, work logins, streaming and calls. Check a lookup without an explicit server too:
nslookup example.comIf the default resolver isn’t the Pi, your router may be forwarding queries or another setting may be taking precedence. Verify with the router configuration and the Pi’s query log. If the browser behaves differently from dig, check Secure DNS/DoH and VPN settings.
Change the LAN settings. Keep a way back.
- Record the old LAN/DHCP DNS and IPv6 DNS settings. Router WAN DNS alone may not control what clients receive.
- Advertise the Pi’s reserved address through LAN DHCP. If the router has a secondary field, leave it blank when supported or use a second filtered resolver. Some routers accept the same Pi address in both fields, but that adds no redundancy.
- Don’t list a public or ISP resolver as an unfiltered “backup” if you expect filtering. Clients can use any advertised resolver, not only after the first fails.
- Review IPv6 router advertisements/DHCPv6. If clients receive an unfiltered IPv6 DNS server, they can bypass the IPv4 setup. Use a stable LAN IPv6 address for the filter where supported and verify it; consult your router documentation if those settings are locked.
- Reconnect Wi-Fi or renew DHCP leases, then check several devices. Guest networks and VLANs may need their own DNS settings and firewall access to the Pi.
Some routers only advertise themselves as DNS. If they can forward to the Pi, test that arrangement; the query log may show the router instead of individual clients. Avoid a forwarding loop where the router uses the Pi and the Pi uses the router as its upstream.
If the household loses DNS
- Open the router using its numeric LAN IP from your worksheet.
- Restore the previous LAN/DHCP and IPv6 DNS settings. Restore WAN DNS too if you changed it.
- Reconnect or renew leases on affected devices. Test a normal website.
- After service is restored, diagnose the Pi. Filtering is off for devices using the restored resolver.
Logs, backups and a daily check.
Start with conservative blocklists
Add lists gradually. If a login or app breaks, reproduce it and inspect the query log for that device and time. Allow only the required hostname when appropriate, then retest. “More domains blocked” is not automatically a better result.
Keep less browsing metadata
Review query-log and statistics retention in your installed version. Choose the shortest period you need, or disable query logging when troubleshooting is done. DNS logs can reveal sensitive activity, but they are not a complete browser history.
Back up configuration and data
Use the official backup procedure for your installation. Preserve the configuration and required data directory. Stop the service for a consistent manual backup, then start it again; schedule the short DNS interruption.
Treat backups as secrets. They may include password hashes, upstream credentials, TLS private keys and client information. Keep encrypted backups outside Git, restrict access, and practise restoring on a spare system before relying on them.
Get an aggregate report
The companion Python script reads AdGuard Home’s status and statistics API. It prints query counts, blocked counts and average processing time. It makes no configuration changes and omits client addresses and queried domains from its output.
AdGuard Home does not provide a built-in read-only reporter role. An account used by the script may still have administrative capabilities. Prefer running the report on the Pi against a loopback listener; if the dashboard listens only on its LAN address, use the SSH tunnel example in the kit. Use verified HTTPS for a remote endpoint. The kit explains credential-file permissions and scheduling.
python3 configure.py
python3 report.py --hours 24The report prints to your terminal. The optional cron example saves a private local report; email requires a separately configured mail tool and is not built into this kit. A report scheduled on a powered-off Pi cannot alert you that it is down.
Follow the symptom.
Nothing answers on port 53
Check the reserved address, power, Ethernet and service state. Ensure the DNS listener is bound to the intended interface, and that the host firewall permits LAN DNS over both UDP and TCP 53. Look for an existing DNS service using the port. Don’t disable services blindly.
sudo systemctl status AdGuardHome --no-pager
sudo journalctl -u AdGuardHome -n 50 --no-pager
sudo ss -lntup | grep -E ":(53|80|3000)\b"These service commands apply to the standard Linux service installation. Container users should inspect their container and port mappings instead.
DNS works, but ads still appear
Check whether that device’s queries appear in the log. Review IPv6 DNS, Secure DNS/DoH, VPN DNS, guest-network settings and cached answers. Ads served from the same domain as wanted content may not be blockable without breaking the content. Some tracking doesn’t require a new DNS lookup.
Filtering works in dig, but not in the browser
Your browser may use its own encrypted DNS. For your own test device, temporarily set it to use the system resolver and retest. Managed devices may enforce settings you cannot change. Restore your preferred configuration after the test.
A website or work login broke
Match the failure time to blocked requests in the query log. Temporarily test the specific rule or hostname, then narrow the exception. If you need the network immediately, use the rollback steps. Don’t leave filtering disabled without noting why.
The dashboard is unreachable but DNS still works
The web interface and DNS listener are separate. Use the admin URL and port chosen in the wizard, check the web listener, and inspect service logs. Don’t reinstall until you have a backup.
Can I force every device through HiveNet?
Some routers can restrict or redirect ordinary DNS traffic, but port-53 rules do not cover DoH over HTTPS, DoT, VPNs or direct-IP traffic. Redirecting the Pi’s own traffic can also create a loop. Firewall enforcement is an advanced, router-specific step outside this setup.
Can this replace my router or a VPN?
No. This guide adds a DNS filter. Your router still handles routing and Wi-Fi. A VPN routes traffic through a tunnel; DNS filtering performs a different job.
Check it off when it works.
Progress stays in this browser. It is your checklist, not an automatic network test.
The HiveNet companion kit.
A small, readable toolkit for your own network. No account, email gate or third-party Python packages.
- Python report: status and aggregate DNS statistics, with an interactive private-config setup tool.
- Setup notes: API credentials, HTTPS, cron and troubleshooting.
- Rollback worksheet: record your old settings before cutover.
- Verification checklist: repeatable checks for allowed queries, blocking and bypasses.
Version 2026.11.03 · SHA-256 checksums · Tested with synthetic API fixtures; not verified against your router or Pi.
Built on open-source tools.
AdGuard Home is developed by AdGuard. HiveNet is my project name, not an official product or a new router.
- AdGuard Home: getting started
- Configuration, listeners and upstreams
- FAQ, limitations and backups
- Official API specification
- Quad9 services and endpoints
- Mullvad public DNS service notice
- Raspberry Pi setup documentation
What changed in this edition?
Removed the discontinued Mullvad DNS recommendation, corrected filtering and backup claims, removed the nonexistent read-only reporter role, added IPv6 and recovery checks, and added the downloadable reporting kit. Earlier reels show the setup at the time they were recorded; follow this edition for current setup guidance.
More field notes, when they’re ready.
The guide and kit above are free. Email signup is optional, for future HiveNet updates.