Project write-up
Self-hosted DNS with AdGuard Home
A DNS server I run myself, so every device on my main network gets ad, tracker and threat blocking, and my homelab gets a place for internal names.
Goal
I wanted ads, trackers and known threats blocked for every device on my main network without installing anything on the devices themselves. I also needed a DNS server I control, so my homelab services can have internal names.
Setup
Clients
Main network
Every device, no per-device setup
DHCP
Router
Hands out AdGuard Home as the DNS server
Filtering
AdGuard Home
Ubuntu VM on NodeWeaver, three blocklists
Upstream
Quad9 (DoH)
Encrypted, with 1.1.1.1 as fallback
The guest network doesn't use it.
What I did, and why
- Gave DNS its own VM. AdGuard Home runs on Ubuntu in a dedicated virtual machine on my NodeWeaver homelab, independent of my other lab services.
- Reserved its IP address. A DHCP reservation keeps the VM's address from changing, so the router can always hand it out as the network's DNS server.
- Pointed the router's DHCP at it. Every device on the main network picks it up automatically, with nothing to configure on phones, laptops or smart devices.
- Kept the guest network off it. Guests stay separate from my homelab, and if a blocklist ever causes problems, visitors aren't affected.
- Chose three complementary blocklists. HaGeZi Pro covers ads and tracking, HaGeZi Threat Intelligence Feeds covers malware and phishing, and OISD Big adds broad, well-maintained coverage with few false positives.
- Encrypted the upstream. Queries leave my network as DNS-over-HTTPS to Quad9, so my ISP can't read or tamper with them.
- Used Quad9's unfiltered service on purpose. I chose the variant without Quad9's own threat blocking, so every block happens in AdGuard Home, where I can see it in the query log and allowlist it if needed. Quad9 still validates DNSSEC.
- Set a fallback inside AdGuard, not on the router. 1.1.1.1 is configured as AdGuard Home's fallback, used only if Quad9 can't be reached. Devices treat a second DNS server from the router as an equal choice, which would let some lookups skip filtering.
Results
24%
of DNS queries blocked, per the AdGuard Home dashboard
0
false positives so far that needed allowlisting
Lessons
- Where a backup DNS server lives matters. On the router it becomes a way around filtering; inside AdGuard it only covers upstream outages.
- Public resolvers come in several variants. Knowing what each one does, and doesn't, block lets me decide where filtering should happen.
Next steps
- Split-horizon DNS: a wildcard rewrite so *.samkitay.dev resolves to my reverse proxy, only inside my network.
- A Caddy reverse proxy with one wildcard certificate for those lab services.