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.

FBFenwei BianAuthorNov 24, 2026
  • 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 fieldMeaning
version: 0This exchange uses EDNS version zero.
flags: doThe DNSSEC OK bit is set. In a query it requests DNSSEC data. It does not mean the client validated the answer.
udp: 1232The responder advertises a UDP payload size. It does not mean the response you received is 1,232 bytes.
MSG SIZE rcvdThis 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.

  1. Run dig @ns.example.test example.test DNSKEY +dnssec +bufsize=1232 +ignore. The BIND +ignore option prevents the automatic TCP retry on a truncated reply so you can inspect the UDP result.
  2. If the header includes tc, the UDP reply is truncated. Run dig @ns.example.test example.test DNSKEY +dnssec +tcp to request the same records over TCP.
  3. 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.

Sources and further reading

About the author(s)

Software Developer & Writer • Namefi
FBAuthor

Fenwei Bian is a software developer in her thirties who spends her working hours in pull requests and her weekends with her hands in soil or sawdust. Years of open source on GitHub taught her that names are interfaces: a good one is clear, honest about what it does, and kind to whoever has to use it next.

She gardens because it rewards patience and punishes wishful thinking, and she does woodwork because a joint either fits or it doesn't. Both habits show up in how she writes about naming — measure twice, check the source, and don't sand over a rough spot and hope no one notices.

For Namefi she writes about how domain markets actually move, the practical trade-offs of tokenizing and flipping names, and picking a domain you'll still be glad you own in twenty years.

Related guides

Discuss this post

View the discussion on Namefi Discuss