NSEC Record
Next Secure
- Type code
- 47
- Status
- In use
- Defined in
- RFC 4034
What the NSEC record is for
DNSSEC has to prove negative answers too, otherwise an attacker could forge a "no such name" response. NSEC does this by chaining every name in the zone in canonical order: each NSEC record names the next existing name and lists the record types present at its own owner name. Because NSEC records are signed, a resolver can verify that no name exists between two links, or that a type is missing at a name.
The drawback is that following the chain reveals every name in the zone (zone walking). NSEC3 was created to make that harder. Servers that sign on the fly can instead return minimally covering NSEC records (RFC 4470) or the compact denial form in RFC 9824, which avoid exposing real neighbouring names.
Resolvers can also reuse cached, validated NSEC records to answer queries for other names they cover without asking again (aggressive use, RFC 8198).
Wire format and fields
| Field | Size | Meaning |
|---|---|---|
| Next Domain Name | domain name | The next owner name in canonical order that has authoritative data or a delegation. The last NSEC in the zone points back to the apex. Not compressed on the wire. |
| Type Bit Maps | variable | The record types that exist at the NSEC owner name, encoded as a series of windowed bitmaps. |
Zone file syntax
<owner> <ttl> IN NSEC <next domain name> <type> [<type> …]
Example
The NSEC record at isc.org, fetched from live DNS on 27 November 2026:
isc.org. 3600 IN NSEC _acme-challenge.isc.org. A NS SOA MX TXT AAAA NAPTR RRSIG NSEC DNSKEY CDS CDNSKEY HTTPS CAA TYPE65534
The next name after isc.org is _acme-challenge.isc.org. TYPE65534 is a private-use type that some signers use to track signing state.
Common mistakes
- Expecting NSEC to hide zone contents. Anyone can walk the chain and list every name, so do not put names you consider private in a zone signed with NSEC.
- Giving NSEC records a long TTL while the SOA negative TTL is short. Since RFC 9077 the NSEC TTL should be the lesser of the SOA MINIMUM and SOA TTL; a longer one lets resolvers keep denying names you have since added.
- Hand-editing a signed zone and adding names without re-signing, which leaves the NSEC chain pointing past the new names so they are reported as nonexistent.
Specifications
- RFC 4034: Resource Records for the DNS Security Extensions
- RFC 4470: Minimally Covering NSEC Records and DNSSEC On-line Signing (Lets on-line signers return NSEC records that cover only the queried name.)
- RFC 8198: Aggressive Use of DNSSEC-Validated Cache (Lets resolvers answer from cached NSEC records.)
- RFC 9077: NSEC and NSEC3: TTLs and Aggressive Use (Sets the NSEC TTL to the lesser of the SOA MINIMUM field and the SOA TTL.)
- RFC 9824: Compact Denial of Existence in DNSSEC (Defines a compact NSEC form for on-line signers and the NXNAME pseudo-type.)
- IANA DNS Resource Record (RR) TYPEs registry: type code and status
Related record types
Domain Intelligence APIs
Get started with our easy-to-use API docs.