BlogHomelab
HomelabA Quiet DNS and Telemetry Stack for the Lab
AdGuard Home in front of Unbound, plus Prometheus and Grafana, for DNS that is predictable and metrics that actually get used.
- Published
- Reading time
- 7 min read
- Category
- Homelab
- dns
- unbound
- prometheus
- grafana
- adguard
On this page
Most lab outages I have caused were not exotic. They were DNS going sideways, or a host running hot for a week because nothing was scraping it. This stack is intentionally small: AdGuard Home as the lab-facing resolver, Unbound as the recursive engine, and a Prometheus plus Grafana pair that watches the rack without becoming another project.
Both service VMs live on VLAN 99. DHCP on OPNsense points every VLAN at 10.10.99.53. Nothing on the LAN is configured to use a public resolver directly.
DNS: AdGuard in front, Unbound behind
AdGuard Home is the only daemon clients talk to. It applies blocklists and rewrite rules for internal names, then forwards to Unbound on localhost. Unbound does real recursion (with DNSSEC) and only falls back to a TLS upstream if the root path is broken — which I treat as an incident, not as the normal path.
A trimmed Unbound server block:
server:
interface: 127.0.0.1
port: 5335
do-ip4: yes
do-ip6: yes
do-udp: yes
do-tcp: yes
access-control: 127.0.0.1/32 allow
access-control: ::1 allow
hide-identity: yes
hide-version: yes
harden-glue: yes
harden-dnssec-stripped: yes
prefetch: yes
cache-min-ttl: 60
cache-max-ttl: 86400
private-address: 10.0.0.0/8
private-address: 172.16.0.0/12
private-address: 192.168.0.0/16
private-domain: "lab.internal."
domain-insecure: "lab.internal."
AdGuard’s upstream is then 127.0.0.1:5335. Lab-local names (pve-01.lab.internal, nas.lab.internal, and so on) are rewrites in AdGuard so I do not have to run a full hidden master for a handful of records. If that list ever gets long enough to be embarrassing, it will move into a proper zone.
I also refuse to leak RFC1918 or .lab.internal queries off-net. Unbound’s private-address and private-domain settings catch mistakes; AdGuard’s query log is how I notice them.
What Prometheus actually scrapes
The monitoring VM is 10.10.99.20. A short prometheus.yml keeps the job list honest:
global:
scrape_interval: 30s
evaluation_interval: 30s
scrape_configs:
- job_name: prometheus
static_configs:
- targets: ["localhost:9090"]
- job_name: nodes
static_configs:
- targets:
- "10.10.10.1:9100" # firewall, if exporter is enabled
- "10.10.20.11:9100" # pve-01
- "10.10.20.12:9100" # pve-02
- "10.10.30.10:9100" # truenas
- "10.10.99.53:9100" # dns vm
- "10.10.99.20:9100" # monitoring itself
- job_name: unbound
static_configs:
- targets: ["10.10.99.53:9167"]
- job_name: adguard
static_configs:
- targets: ["10.10.99.53:9617"]
Firewall rules on OPNsense allow those scrape ports only from 10.10.99.20. Node exporters are not a reason to open the management VLAN to the world.
Grafana and a short alert list
Grafana sits in front of Prometheus with a handful of dashboards: node resources, ZFS pool capacity, Unbound cache and error rates, and a simple up/down panel for each service. I would rather have four panels I look at than twenty I ignore.
Alerts stay equally short:
- A node or exporter has been down for more than five minutes.
- A ZFS pool is over 80 percent used.
- Unbound’s SERVFAIL ratio is climbing.
- The monitoring VM’s own TSDB is close to the volume cap.
When this stack itself is in maintenance — a Grafana upgrade, a retention change — the exporters can stay up. I would rather lose pretty graphs for an hour than scrape noise from a half-migrated Prometheus.
A two-minute health check
After a DNS or telemetry change I run the same small checklist:
dig @10.10.99.53 pve-01.lab.internal +short
dig @10.10.99.53 example.com +dnssec +norecurse # should fail; clients are not talking to Unbound directly
dig @127.0.0.1 -p 5335 example.com +dnssec +short
curl -sS http://10.10.99.20:9090/-/ready
If local names resolve, recursion still happens only on loopback, and Prometheus says it is ready, the quiet stack is doing what it was installed to do.