diff options
| author | Shulhan <ms@kilabit.info> | 2024-04-01 05:02:42 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2024-04-12 06:28:16 +0700 |
| commit | 6361b4a088ee67e34887430b4a57f330c08d15b3 (patch) | |
| tree | 76e6f3ebd3b922c26ff49c31359370cdef9ef821 /_doc | |
| parent | 77b2da671a29eff58925c13ea0e690c3977698a5 (diff) | |
| download | pakakeh.go-6361b4a088ee67e34887430b4a57f330c08d15b3.tar.xz | |
lib/dns: fix packing and unpacking OPT record
The RDATA in OPT records can contains zero or _more_ options.
Previously, we only handle unpacking and packing one option, now we
handle multiple options.
Diffstat (limited to '_doc')
| -rw-r--r-- | _doc/RFC_6891_EDNS0.adoc | 76 | ||||
| -rw-r--r-- | _doc/index.adoc | 2 |
2 files changed, 78 insertions, 0 deletions
diff --git a/_doc/RFC_6891_EDNS0.adoc b/_doc/RFC_6891_EDNS0.adoc new file mode 100644 index 00000000..966cbff3 --- /dev/null +++ b/_doc/RFC_6891_EDNS0.adoc @@ -0,0 +1,76 @@ += Extension Mechanisms for DNS - EDNS(0) +:toc: +:sectlinks: + +The +https://datatracker.ietf.org/doc/html/rfc6891[RFC 6891] +define the pseudo resource record (RR) or meta RR for DNS named OPT. + +The OPT record provides an extension to DNS, nicknamed as "EDNS(0)", which +was previously called "EDNS0" specified in +https://datatracker.ietf.org/doc/html/rfc2671/[RFC 2671]. + +The OPT RR has RR type 41 (0x21). + +The OPT record can only be added to the additional section of DNS response. + +== Implementation requirements + +OPT RRs MUST NOT be cached, forwarded, or stored in or loaded from master +files. + +When an OPT RR is included within any DNS message, it MUST be the +only OPT RR in that message. +If a query message with more than one OPT RR is received, a FORMERR (format +error with response code (RCODE) value 1) MUST be returned. + +== Record format + +The OPT RR changes the definition of CLASS and TTL from normal DNS RR. + +---- ++--------+ +| NAME | ; 2-octets, MUST be 0 (an empty label). ++--------+ +| TYPE | ; 16-bit unsigned integer, with value 0x0029 (or 41) ++--------+ +| CLASS | ; 16-bit unsigned integer, requester's UDP payload size. ++--------+ +| TTL | ; 32-bit unsigned integer, extended RCODE and flags. +| | ++--------+ +| RDLEN | ; 16-bit unsigned integer, length of RDATA. ++--------+ +/ RDATA / ; Arbitrary length based on RDLEN. ++--------+ +---- + +Inside the TTL, the extended RCODE and flags define as below, + +---- ++----------------+ +| EXTENDED-RCODE | 1-octet, the extended RCODE. ++----------------+ +| VERSION | 1-octet, version of implementation. ++----------------+ +| DO | 1-bit. ++----------------+ +| Z | 15-bit, zero bits. ++----------------+ +---- + +Note that EXTENDED-RCODE value 0 indicates that an unextended RCODE is in +use. + +The RDATA contains zero or more options as a pair of code-value in the +following format, + +---- ++---------------+ +| OPTION-CODE | ; 2-octets. ++---------------+ +| OPTION-LENGTH | ; 2-octets, the length of value in octets. ++---------------+ +/ OPTION-VALUE / ; Arbitrary length of value based on OPTION-LENGTH; ++---------------+ +---- diff --git a/_doc/index.adoc b/_doc/index.adoc index 7db30f9a..5f71f567 100644 --- a/_doc/index.adoc +++ b/_doc/index.adoc @@ -102,6 +102,8 @@ SPF:: DNS:: + -- +* link:RFC_6891_EDNS0.html[RFC 6891: Extension Mechanisms for DNS (EDNS(0))^] + * link:RFC_9460__SVCB_and_HTTP_RR.html[RFC 9460 Service Binding and Parameter Specification via the DNS (SVCB and HTTPS Resource Records)] -- |
