~kris/dots

srice

srice/doc/networking/host-hardening/dns.md -rw-r--r-- 1.8 KiB
e98f3b03 — Kris Yotam chore: sync local state after restore (push updates, no pull) a month ago

#DNS Security

#Architecture Stack

  1. Unbound recursive resolver: validates DNSSEC, queries root servers directly, no upstream forwarders
  2. AdGuard Home or Pi-hole sinkhole layer in front of Unbound
  3. DNS-over-TLS (DoT) for any forwarded queries (port 853)
  4. Firewall rule: block ALL outbound port 53 except from your resolver. NAT redirect rogue DNS to 127.0.0.1:53

#DNSSEC with Unbound

Key config:

auto-trust-anchor-file: "/var/lib/unbound/root.key"  # RFC 5011 auto-managed
val-clean-additional: yes                              # remove unvalidated data
harden-glue: yes                                       # trust glue within delegation only
harden-dnssec-stripped: yes                            # require DNSSEC for signed zones

#Additional Hardening

use-caps-for-id: yes       # 0x20 encoding against cache poisoning
ip-ratelimit: 1000         # prevents DNS amplification if exposed
harden-below-nxdomain: yes
harden-referral-path: yes

#Hardened Unbound Config

Community-maintained, DoT 1.3 via Cloudflare + CleanBrowsing, DNSSEC, multi-threaded: https://gist.github.com/timothymiller/79fd2a99fb1a14b82fbf7c72b77a582c

OPNsense ships with Unbound integrated: https://docs.opnsense.org/manual/unbound.html

#References

#NSA DNS Guidance

Three documents covering the full spectrum:

  1. Defending Your DNS Infrastructure (DNSSEC)
  2. Adopting Encrypted DNS (DoH/DoT)
  3. Selecting a Protective DNS Service (PDNS)

See government-guides/nsa.md for URLs.