| 1 |
# Mountaineer unbound: local validating, recursive, caching DNS resolver |
| 2 |
# on 127.0.0.1 and ::1. Forwards upstream over DNS-over-TLS to a documented |
| 3 |
# pair (Quad9 and Cloudflare). Validates DNSSEC. |
| 4 |
# |
| 5 |
# /etc/resolv.conf points at 127.0.0.1 and the operator does not edit it. |
| 6 |
# Per-domain stub zones (e.g. for a Nebula mesh) go in |
| 7 |
# /etc/unbound/unbound.conf.d/*.conf. |
| 8 |
|
| 9 |
server: |
| 10 |
# Bind only on loopback. Mountaineer hosts do not run an authoritative |
| 11 |
# resolver for the network. |
| 12 |
interface: 127.0.0.1 |
| 13 |
interface: ::1 |
| 14 |
port: 53 |
| 15 |
|
| 16 |
# Privacy and hygiene. |
| 17 |
do-ip4: yes |
| 18 |
do-ip6: yes |
| 19 |
do-udp: yes |
| 20 |
do-tcp: yes |
| 21 |
prefetch: yes |
| 22 |
prefetch-key: yes |
| 23 |
qname-minimisation: yes |
| 24 |
harden-glue: yes |
| 25 |
harden-dnssec-stripped: yes |
| 26 |
harden-below-nxdomain: yes |
| 27 |
harden-referral-path: yes |
| 28 |
use-caps-for-id: yes |
| 29 |
|
| 30 |
# DNSSEC validation. Trust anchor is installed by the unbound-anchor |
| 31 |
# tool at install time; this path is Alpine's convention. |
| 32 |
auto-trust-anchor-file: "/var/lib/unbound/root.key" |
| 33 |
|
| 34 |
# Cache and threading sized for a typical Mountaineer host. |
| 35 |
num-threads: 2 |
| 36 |
msg-cache-size: 32m |
| 37 |
rrset-cache-size: 64m |
| 38 |
cache-min-ttl: 60 |
| 39 |
cache-max-ttl: 86400 |
| 40 |
|
| 41 |
# Access control: localhost only. |
| 42 |
access-control: 127.0.0.0/8 allow |
| 43 |
access-control: ::1 allow |
| 44 |
access-control: 0.0.0.0/0 refuse |
| 45 |
access-control: ::/0 refuse |
| 46 |
|
| 47 |
# Hide identity and version from outside queries. |
| 48 |
hide-identity: yes |
| 49 |
hide-version: yes |
| 50 |
|
| 51 |
# Logging — minimal by default. Per-incident debug is via unbound-control. |
| 52 |
verbosity: 1 |
| 53 |
log-queries: no |
| 54 |
log-replies: no |
| 55 |
|
| 56 |
# Run unprivileged. |
| 57 |
username: "unbound" |
| 58 |
directory: "/etc/unbound" |
| 59 |
chroot: "" |
| 60 |
pidfile: "/run/unbound.pid" |
| 61 |
|
| 62 |
# Forward to DoT upstreams. Quad9 and Cloudflare picked as the documented |
| 63 |
# default pair; operators with a preferred resolver edit a drop-in in |
| 64 |
# /etc/unbound/unbound.conf.d/. |
| 65 |
forward-zone: |
| 66 |
name: "." |
| 67 |
forward-tls-upstream: yes |
| 68 |
forward-addr: 9.9.9.9@853#dns.quad9.net |
| 69 |
forward-addr: 149.112.112.112@853#dns.quad9.net |
| 70 |
forward-addr: 1.1.1.1@853#cloudflare-dns.com |
| 71 |
forward-addr: 1.0.0.1@853#cloudflare-dns.com |
| 72 |
forward-addr: 2620:fe::fe@853#dns.quad9.net |
| 73 |
forward-addr: 2606:4700:4700::1111@853#cloudflare-dns.com |
| 74 |
|
| 75 |
# Drop-in directory for operator additions (stub zones, custom forwards, |
| 76 |
# additional access-control entries, etc.). |
| 77 |
include: "/etc/unbound/unbound.conf.d/*.conf" |
| 78 |
|
| 79 |
remote-control: |
| 80 |
control-enable: yes |
| 81 |
control-interface: 127.0.0.1 |
| 82 |
control-use-cert: no |
| 83 |
|