Skip to content

DNSSEC

The server checks the signatures of every answer it gets from outside, from the keys of the root down to the records. A name whose signatures fail answers SERVFAIL. A name whose signatures pass can carry the AD bit, which tells the client that the server checked it. DNSSEC (the DNS Security Extensions) is the system of keys and signatures that makes the check possible. The check is on by default, and it needs no entry in a file.

This page says what a client sends, what it gets back, and what each answer means. The entries that change the check are in Configuration. The failures are in Troubleshooting.

A zone owner signs each set of records in the zone. The key that signs a zone is in the zone, and a DS record in the parent zone names that key. So a chain of signatures runs from the root to each signed name. The server follows that chain for each answer, and the result is one of these states:

State What it means What the client gets
secure A chain of signatures runs from the root to the answer, and each one passed The records, with AD where asked
insecure The server proved that the zone is not signed, or it does not check the zone The records, with AD clear
bogus A chain has to run to the answer, and it is broken SERVFAIL, or the records with CD
indeterminate The server cannot decide, because of its clock or its root keys The records with AD clear, or SERVFAIL

A name that answers NXDOMAIN or has no record of the type asked for is checked too. The zone proves the denial with NSEC or NSEC3 records, which name the gaps between the names in the zone. A denial from a signed zone with no proof is bogus. A denial from an unsigned zone needs no proof, and it is insecure.

The server trusts its clock once a time client sets it. Before that, a signature whose times fail gives SERVFAIL, because a wrong clock and a wrong signature look the same. “Signed names fail, and the server does not trust the clock” in Troubleshooting covers that case.

The server keeps the keys of the root current by itself. “DNSSEC” in Configuration says how, and which metrics follow it. If every signed name fails, read “Every name fails validation, because of the root keys” in Troubleshooting.

The query log writes the state of each answer in its dnssec column. The query log has the column. The column reads unchecked where the check is off, and it is empty for an answer that the server wrote itself. That is a zone of yours, a blocked name, or a refusal.

A client uses three bits of the query to say what it wants to know about signatures.

Bit Where it is What the client asks for
DO (DNSSEC OK) The OPT record The signatures and the proofs, beside the records
AD (Authentic Data) The header The AD bit in the answer, where the answer is secure
CD (Checking Disabled) The header The records of a bogus answer, in place of SERVFAIL

The server sets the AD bit in an answer only where the state is secure and the query set DO or AD. Many programs set neither bit, so they never see AD, even for a signed name. dig sets AD by default, and dig +dnssec sets DO as well. A denial gets AD only where its authority section holds nothing but the SOA record, the proof and their signatures.

With DO clear, the answer holds no RRSIG, NSEC or NSEC3 record. The one exception is a record in the answer section whose type the question asked for. A question for type ANY asks for every type, so it keeps them all. With DO set, the answer holds the signatures of its records. A record that a wildcard made also comes with the NSEC or NSEC3 record that proves that no closer name exists. A client that checks signatures itself needs that record.

A bogus answer is SERVFAIL with an Extended DNS Error code, which dig shows on an EDE: line. The code names the fault. “An EDE: line in dig” in Troubleshooting lists each code and what to do about it.

To see the records that failed, ask again with dig +cd. “One signed name answers SERVFAIL, and dig +cd answers it” in Troubleshooting shows the two queries. It also says what to do about a zone that stays broken.

The cache serves a query with DO or CD set, the same as any other query. With the check on, the server asks each upstream with DO set, so the cache holds the signatures and the proofs. It sends them to a client that asks with DO. It holds a bogus answer for failure_ttl, 60 seconds by default. In that time, a query with CD clear gets SERVFAIL again, and a query with CD set gets the records from the cache.

A route that does not check signatures is different. That is a server with dnssec_validation = false, or a [[forward]] with dnssec = "insecure". On such a route, a query with DO or CD goes past the cache in both directions. Nothing on that route checks the records, so the cache holds no signatures for them to give. A client that asked for them gets them from the upstream.

The check is on unless server.toml turns it off:

dnssec_validation = false

With it off, the server answers what the upstream sends, and it never sets the AD bit. Turn it off where an upstream removes the signatures and you cannot replace it.

To stop the check for one suffix, and keep it for the rest, use a [[forward]] with dnssec = "insecure". That is for a zone on your network that has no chain to the root. To answer a public zone whose signatures are broken, use a [[negative_trust_anchor]], which ends by itself. Configuration has both entries.