File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -203,6 +203,11 @@ In OpenNIC mode:
203203
204204- Unbound bootstraps from the OpenNIC root servers (` opennic.hints ` ) and never
205205 contacts the ICANN root servers, internic.net, or IANA.
206+ - Unbound keeps a local copy of the root zone, transferred from those same root
207+ servers, so delegations come from a complete zone instead of from referrals
208+ cached per query. This mirrors what the ICANN path does with the root zone
209+ from internic.net. If the transfer fails, Unbound falls back to querying the
210+ root servers directly.
206211- DNSSEC validation is anchored to the OpenNIC root key (` opennic.key ` ) and
207212 kept up to date automatically (RFC 5011). The OpenNIC root also serves the
208213 DS records of the ICANN TLDs, so DNSSEC keeps working for the regular
Original file line number Diff line number Diff line change @@ -147,6 +147,26 @@ server:
147147 root-hints: "opennic.hints"
148148 auto-trust-anchor-file: "var/opennic.key"
149149EOT
150+
151+ # Keep a local copy of the root zone, like the ICANN path does. Without it
152+ # every delegation is a cached referral from whichever root server answered,
153+ # so a single server serving stale data can break a TLD until the cache
154+ # expires. Slaved from the servers already in opennic.hints, so this adds no
155+ # dependency beyond the root servers Unbound is configured to use.
156+ opennic_masters=$( awk ' $1 !~ /^;/ && $3 == "A" { printf " master: %s\n", $4 }' \
157+ /opt/unbound/etc/unbound/opennic.hints)
158+ if [ -n " $opennic_masters " ]; then
159+ cat >> /opt/unbound/etc/unbound/unbound.conf << EOT
160+
161+ auth-zone:
162+ name: "."
163+ ${opennic_masters}
164+ fallback-enabled: yes
165+ for-downstream: no
166+ for-upstream: yes
167+ zonefile: "var/opennic-root.zone"
168+ EOT
169+ fi
150170else
151171 cat >> /opt/unbound/etc/unbound/unbound.conf << EOT
152172
You can’t perform that action at this time.
0 commit comments