XiaTools

Unbound Resolver Configuration for Strict DNSSEC Validation Policies

By Rohit, founder of XiaTools · Updated 21 Oct 2026

Implementing unbound resolver strict dnssec validation guarantees that your recursive DNS server drops any response failing cryptographic signature checks rather than falling back to unvalidated data. This security posture prevents attackers from injecting malicious IP addresses into your DNS cache via spoofing or cache poisoning. By enforcing strict trust anchor validation, your infrastructure strictly adheres to the security chains established by the root zone and top-level domains.

Before diving into complex deployments, you should always verify the current DNSSEC status of your domain using the DNSSEC Checker to inspect DS records, key tags, and algorithm types before forcing strict policies on your recursive resolvers.

Understanding Strict DNSSEC Validation in Unbound

By default, Unbound provides robust DNSSEC validation, but its default operational mode can occasionally tolerate certain validation failures depending on how trust anchors and negative trust anchors are managed. Setting up a strict policy means that if a zone is signed, and its cryptographic chain of trust is broken, expired, or invalid, Unbound returns a SERVFAIL status to the client. No fallback occurs.

How Trust Anchors Drive Validation

Unbound relies on cryptographic keys known as Trust Anchors (TAs) to anchor the root of the Domain Name System. When a recursive client queries example.com, Unbound verifies:

  1. The DNSKEY record of the .com zone signed by the Root Zone.
  2. The DS record in .com matching the DNSKEY of example.com.
  3. The RRSIG signatures covering the resource records inside example.com using the zone's public key.

If any link in this cryptographic chain fails validation—such as an expired signature or a mismatched DS digest—a strict Unbound configuration halts resolution immediately.

Step-by-Step Configuration Guide

Configuring unbound resolver strict dnssec validation involves modifying your primary configuration file, typically located at /etc/unbound/unbound.conf. Follow these steps to lock down your resolver.

Step 1: Open and Edit the Unbound Configuration

Open your configuration file using your preferred text editor with administrative privileges:

sudo nano /etc/unbound/unbound.conf

Step 2: Configure Server-Wide Validation Directives

Locate the server: block and ensure that the auto-trust-anchor file is specified, and that validation parameters are tightly controlled. Add or uncomment the following lines:

server:
    # Enable cryptographic validation
    val-clean-additional: yes
    
    # Automatically manage root trust anchors via RFC 5011
    auto-trust-anchor-file: "/var/lib/unbound/root.key"
    
    # Enforce strict adherence to DS records
    harden-dnssec-stripped: yes
    
    # Reject expired signatures and future timestamps
    val-permissive-mode: no

Step 3: Enforce Strict Forward Zones (Optional)

If you forward queries to upstream forwarders (such as local enterprise forwarders or secure public resolvers), you must ensure that the forwarder also performs validation, or instruct Unbound to validate the forwarded answers locally:

forward-zone:
    name: "."
    forward-addr: 192.0.2.2
    forward-ssl-upstream: yes

Note: When forwarding to external IPs, ensure your upstream provider supports DNSSEC properly, or configure Unbound to validate the responses independently.

Step 4: Test Configuration Syntax

Before restarting the Unbound service, always validate the syntax of your configuration file to prevent downtime:

unbound-checkconf

Sample successful output:

unbound-checkconf: no errors in unbound.conf

Step 5: Restart and Verify the Service

Restart the Unbound daemon to apply your strict validation policies:

sudo systemctl restart unbound

Verifying Strict Validation with Dig

Once configured, you must verify that valid domains resolve correctly and invalid domains trigger a SERVFAIL response. You can use the dig command-line utility against your local Unbound instance (running at 127.0.0.1).

Testing a Valid Domain

Query a known, correctly signed domain:

dig @127.0.0.1 isc.org +dnssec

Look for the ad (Authenticated Data) flag in the header of the response output:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12345
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

The presence of the ad flag confirms that Unbound successfully validated the cryptographic signatures.

Testing a Broken DNSSEC Domain

If you test a domain with intentionally broken DNSSEC (such as dnssec-failed.org), a strict Unbound resolver must return SERVFAIL:

dig @127.0.0.1 dnssec-failed.org

Expected output showing strict failure:

;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 54321
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

Comparison: Permissive vs. Strict DNSSEC Modes

Feature / Behavior Permissive / Default Mode Strict Validation Mode
Invalid Signature Handling Falls back or returns unvalidated data Instantly returns SERVFAIL
Clock Skew Tolerance May tolerate slight clock drifts Strictly enforces expiration times
Security Posture Vulnerable to downgrade attacks Maximum cryptographic assurance
Client Impact Fewer support tickets for broken sites Users cannot access misconfigured sites

Common Mistakes and How to Fix Them

Enforcing strict security policies often exposes underlying maintenance oversights. Avoid these frequent pitfalls:

1. System Clock Drift

DNSSEC relies heavily on absolute time comparisons to verify RRSIG inception and expiration timestamps. If your server clock is off by even a few hours, Unbound will mark all valid signatures as expired or not yet valid.

  • Fix: Configure NTP time synchronization on your resolver host immediately.

2. Missing or Outdated Root Key

If the root.key file is missing or corrupted, Unbound cannot establish the initial trust anchor.

  • Fix: Initialize or update the root key using the Unbound control utility:
unbound-control-setup

3. Intermediate Firewall Blocks

DNSSEC responses are significantly larger than standard DNS replies due to attached keys and signatures. If your network firewall drops UDP packets exceeding 512 bytes, queries will fail over to TCP, or timeout completely.

  • Fix: Ensure your firewalls permit EDNS0 buffer sizes (at least 1232 bytes recommended) and allow TCP port 53 traffic.

Quick Checklist for Deployment

  • System clock synchronized via NTP.
  • auto-trust-anchor-file path correctly defined in unbound.conf.
  • val-permissive-mode set to no.
  • Syntax checked with unbound-checkconf.
  • Tested with dig confirming SERVFAIL on broken zones and ad flags on valid zones.

Frequently asked questions

What happens to clients when Unbound strict validation fails?

When strict validation encounters an invalid signature, mismatched DS record, or expired timestamp, Unbound immediately stops resolution and returns a SERVFAIL response to the client. The client application will treat the domain as unreachable or non-existent, preventing exposure to spoofed data.

Why does my Unbound server return SERVFAIL for every domain after enabling strict mode?

This almost always indicates that your server's system clock is out of sync, or that the root trust anchor file (`root.key`) is missing, unreadable, or outdated. DNSSEC requires accurate timestamps to verify cryptographic signature validity periods.

Do I need to configure forwarders differently when using strict DNSSEC?

Yes. If you forward queries to upstream resolvers or public DNS services, those upstream resolvers must also perform complete DNSSEC validation and pass the Authenticated Data (ad) flag. Alternatively, configure Unbound to perform local validation on the returned responses.

How can I check if my Unbound instance is updating root trust anchors automatically?

Unbound uses RFC 5011 mechanisms to automatically maintain the root key file specified in `auto-trust-anchor-file`. You can verify key status by checking your system logs for successful trust anchor state changes or by inspecting the modification timestamp of the root key file.

Can I bypass strict validation for specific internal domains that are not signed?

Yes. Unbound allows you to define local zones or stub zones, or use domain-specific exceptions, to bypass validation for unsigned internal zones like private Active Directory domains. You can designate these via local-zone directives set to transparent or static.

Related articles

Free tools