What Is EDNS? How to Read OPT Records in DNS Output
Read the EDNS OPT entry in dig, distinguish the advertised UDP size from the actual response, and compare truncated UDP with DNS over TCP.
- dns
- edns
- dns-tools
- guide
Extension Mechanisms for DNS (EDNS) let DNS endpoints exchange capabilities and options using an OPT pseudo-record. A client can advertise a UDP response size it can receive, and it can request features such as DNSSEC records. OPT belongs to the exchange. It is not a record stored in the domain's zone.
Read the OPT pseudo-section
For illustration, a response displayed by dig might include EDNS: version: 0, flags: do; udp: 1232. Read the fields independently.
| Displayed field | Meaning |
|---|---|
version: 0 | This exchange uses EDNS version zero. |
flags: do | The DNSSEC OK bit is set. In a query it requests DNSSEC data. It does not mean the client validated the answer. |
udp: 1232 | The responder advertises a UDP payload size. It does not mean the response you received is 1,232 bytes. |
MSG SIZE rcvd | This separate dig summary shows the actual message size received. |
RFC 6891 defines the fields and the extended payload size. The value the requester advertises limits the size it is asking to handle, but neither endpoint can infer from it that every network path between them can deliver that datagram size.
Check whether UDP truncation explains a missing answer
In a controlled DNS environment, compare UDP and TCP for a record on a nameserver you administer. A signed zone's DNSKEY response is a possible test case. Replace the example zone and server in these commands with your own.
- Run
dig @ns.example.test example.test DNSKEY +dnssec +bufsize=1232 +ignore. The BIND+ignoreoption prevents the automatic TCP retry on a truncated reply so you can inspect the UDP result. - If the header includes
tc, the UDP reply is truncated. Rundig @ns.example.test example.test DNSKEY +dnssec +tcpto request the same records over TCP. - If TCP returns the complete answer, the UDP result did not show that records were missing. If TCP fails, check the TCP listener and the permitted network path for that nameserver. A UDP timeout with no header differs from a reply carrying the truncation flag.
The test does not force truncation. A small response can fit in the advertised UDP size and arrive intact. RFC 7766 explains why DNS implementations also support DNS over TCP. When the server returns an answer, use the dig output guide to read status, flags, and the answer together.
