Use it when large answers disappear, when a query works only without EDNS, or to read the OPT pseudosection in dig output.
DNS EDNS(0) Evidence
1. dig <name> — is there an OPT pseudosection in the answer?
2. dig <name> +noedns — does it work without EDNS when it fails with?
3. Yes → a device on the path mishandles the extension.
4. Large answers lost → set the UDP size to 1232 on the resolver.
5. SERVFAIL → look for an extended error in the OPT section.
query carries OPT with the UDP size and flags → server answers with OPT → answer within the advertised size, or truncated → no fragmentation on the path
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
dig example.comVerification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Operational verification Verify boundary
dig example.com
dig example.com +noedns
dig example.com +bufsize=1232
dig example.com +nsid @192.0.2.53
dig example.com +dnssec
dig prints the OPT record as a pseudosection:
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags: do; udp: 1232
showing the version, the flags and the UDP size the server advertises. +noedns sends a plain query without the extension — useful to see whether EDNS itself is the problem. +bufsize sets the size offered. +nsid asks the server to name itself, and +dnssec sets the DO flag.
Known-good: the answer contains an OPT pseudosection with version 0, and the query works equally with and without EDNS.
Step 2 Failure isolation workflow Narrow the fault
- A query works with
+noednsand fails without it. A firewall or old server on the path mishandles queries that carry OPT. - Large answers disappear, small ones arrive. The advertised UDP size exceeds what the path carries unfragmented; set 1232 on the resolver.
- The answer has no OPT section. The server does not support EDNS; large answers and DNSSEC are unavailable from it.
- FORMERR in reply to ordinary queries. The server rejects the extension; resolvers retry without it, which slows every lookup.
- Answers differ by the client's location. The client-subnet option is in use; that is by design.
- SERVFAIL with no explanation. Look for an extended DNS error option in the reply; newer resolvers state the reason there.
- Different replies from the same address. Several machines share it;
+nsidshows which one answered.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
The advertised UDP size decides how big an answer may be; 1232 bytes avoids fragmentation, larger values invite lost replies. Old firewalls and servers sometimes mishandle queries that carry the extension — dig +noedns shows whether that is the problem.
dig <name>— the OPT pseudosection: version, flags,udp:size.dig <name> +noedns— a plain query without the extension.dig <name> +bufsize=1232— set the size offered.dig <name> +nsid @<server>— which machine answered.dig <name> +dnssec— sets the DO flag.
ReferenceWhat it is1 section · depth on demand
Mechanics & mental model
EDNS is the extension mechanism that lets DNS go beyond the limits of its original design: answers larger than 512 bytes over UDP, extra flags such as the one that requests DNSSEC data, and optional pieces of information attached to a query or answer. It is carried in a special record, OPT, added to the end of a message.
ReferenceWhy it matters1 section · depth on demand
Why it matters operationally
Practically every query sent today uses EDNS, so its settings decide how large an answer may be and whether DNSSEC records come along. Its problems are of two kinds: an advertised size that is too large for the path, so answers are fragmented and lost; and old firewalls or servers that mishandle queries carrying the extension.
ReferenceHow it works1 section · depth on demand
How it works
The OPT record. It appears in the additional section and is not real zone data. It reuses the fields of an ordinary record for its own purposes:
| Field of the record | Used for |
|---|---|
| Name | Empty (the root) |
| Type | 41 = OPT |
| Class | The largest UDP message the sender can receive, in bytes |
| TTL | Split into: an extension of the result code, the EDNS version (0), and flags — notably DO, "DNSSEC OK" |
| Data | A list of options, each with a code, a length and a value |
UDP size. The value tells the other side how big a UDP reply may be. For years 4096 was common, which invited fragmented replies that many networks drop. The current recommendation is 1232: it fits within the smallest IPv6 packet size, so it is never fragmented. Larger answers are truncated and fetched over TCP.
The DO flag asks the server to include DNSSEC records — signatures — in the answer. Resolvers that validate set it on all their queries.
Options in use.
| Code | Option | Purpose |
|---|---|---|
| 3 | NSID | Asks the server to identify itself; useful to see which machine behind a shared address answered |
| 8 | Client subnet | A resolver tells the server roughly where the client is, for location-dependent answers |
| 10 | Cookie | A lightweight check that the sender's address is not forged |
| 12 | Padding | Hides message sizes on encrypted transports |
| 15 | Extended DNS error | Adds a specific reason to a failure such as SERVFAIL |
Negotiation. There is no handshake. A client includes OPT in its query; a server that supports EDNS includes OPT in its answer. A server that does not understand it answers with a format error or without OPT, and the client falls back. A server asked for a version it does not support answers BADVERS.
ReferenceImportant terms & boundaries1 section · depth on demand
In depth
EDNS(0) in packets
EDNS extends DNS without changing the header, by adding a pseudo-record to the additional section. RFC 6891 defines this OPT record (type 41). Its owner name is the root, and its CLASS field holds the requester's UDP payload size. Its TTL field holds an extended RCODE, the EDNS version and flags, including DO (DNSSEC OK). Payload sizes below 512 must be treated as 512, and 4096 is suggested as a starting point. Since then, operators have converged on about 1232 bytes to avoid fragmentation. A message must carry at most one OPT record.
OPT record fields (RFC 6891)
| Field | Normal record meaning | In OPT |
|---|---|---|
| NAME | Owner | Root (empty) |
| TYPE | Record type | 41 |
| CLASS | Class | UDP payload size the sender accepts |
| TTL | Cache time | Extended RCODE, version, DO bit, Z |
| RDATA | Data | Options (cookies, client subnet, padding, …) |
Server behaviour (RFC 6891)
| Situation | Response |
|---|---|
| The server doesn't support EDNS | FORMERR without an OPT record; the client may retry without EDNS |
| Unsupported EDNS version | BADVERS (extended RCODE 16) |
| More than one OPT record | FORMERR |
| DNSSEC needed | Don't fall back to non-EDNS queries |
Choosing a buffer size
| Size | Consequence |
|---|---|
| 512 | Many answers truncated; more TCP |
| About 1232 | Fits in IPv6's minimum MTU without fragmentation |
| 4096 | Large answers are fragmented; fragments are often dropped |
RFC 6891 itself warns that very large values guarantee IP fragmentation and may stop answers arriving.
host$ dig @10.20.0.53 example.net A +noall +comments | grep -A1 "OPT PSEUDOSECTION"
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags: do; udp: 1232
host$ dig @10.20.0.53 example.net A +noedns +noall +comments | grep -c OPT
0
host$ dig @10.20.0.53 example.net A +edns=1 +noall +comments | grep status
;; ->>HEADER<<- opcode: QUERY, status: BADVERS, id: 5120
host$ tshark -r dns.pcap -Y "dns.rr.type == 41" -T fields -e dns.rr.udp_payload_size -e dns.resp.z.do | sort | uniq -c
The +edns=1 test checks whether a server handles unknown EDNS versions correctly, as RFC 6891 requires.
Documented example, not captured output.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Network & Protocols → DNS EDNS(0) Evidence. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc1034.html · confidence 94%Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Operational notes
Former standalone Cheat Sheet content now lives directly inside the Topic where it belongs.
DNS EDNS Quick Reference
OPT record, UDP payload and DO flag.
OPT = EDNS metadata pseudo-record.
UDP payload = advertised receive size.
DO = DNSSEC OK request bit.
Version = EDNS version.
Compare behavior with/without EDNS when middleboxes or fragmentation are suspected.