RFC 8914 PROPOSED STANDARD DNS · DNSSEC · DIAGNOSTICS

Extended DNS Errors

A way for DNS servers to say why a query failed, not just that it failed.

On rfc-editor.org ↗
PUBLISHED
October 2020
AUTHORS
W. Kumari, E. Hunt, R. Arends, W. Hardaker, D. Lawrence
STREAM
IETF
EDNS0 OPTION CODE
15
INFO-CODE WIDTH
16 bits
ERROR CODES DEFINED
25, numbered 0 to 24
FIRST COME FIRST SERVED RANGE
0 to 49151
PRIVATE USE RANGE
49152 to 65535
CLIENTS THAT RETRY ANOTHER RESOLVER
About 11%
DOI
10.17487/RFC8914

RFC text

Contents
Original text · RFC Editor View on rfc-editor.org ↗
Internet Engineering Task Force (IETF)                         W. Kumari
Request for Comments: 8914                                        Google
Category: Standards Track                                        E. Hunt
ISSN: 2070-1721                                                      ISC
                                                               R. Arends
                                                                   ICANN
                                                             W. Hardaker
                                                                 USC/ISI
                                                             D. Lawrence
                                                              Salesforce
                                                            October 2020


                          Extended DNS Errors

Abstract

   This document defines an extensible method to return additional
   information about the cause of DNS errors.  Though created primarily
   to extend SERVFAIL to provide additional information about the cause
   of DNS and DNSSEC failures, the Extended DNS Errors option defined in
   this document allows all response types to contain extended error
   information.  Extended DNS Error information does not change the
   processing of RCODEs.

Status of This Memo

   This is an Internet Standards Track document.

   This document is a product of the Internet Engineering Task Force
   (IETF).  It represents the consensus of the IETF community.  It has
   received public review and has been approved for publication by the
   Internet Engineering Steering Group (IESG).  Further information on
   Internet Standards is available in Section 2 of RFC 7841.

   Information about the current status of this document, any errata,
   and how to provide feedback on it may be obtained at
   https://www.rfc-editor.org/info/rfc8914.

Copyright Notice

   Copyright (c) 2020 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (https://trustee.ietf.org/license-info) in effect on the date of
   publication of this document.  Please review these documents
   carefully, as they describe your rights and restrictions with respect
   to this document.  Code Components extracted from this document must
   include Simplified BSD License text as described in Section 4.e of
   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.

Table of Contents

   1.  Introduction and Background
     1.1.  Requirements Notation
   2.  Extended DNS Error EDNS0 Option Format
   3.  Extended DNS Error Processing
   4.  Defined Extended DNS Errors
     4.1.  Extended DNS Error Code 0 - Other
     4.2.  Extended DNS Error Code 1 - Unsupported DNSKEY Algorithm
     4.3.  Extended DNS Error Code 2 - Unsupported DS Digest Type
     4.4.  Extended DNS Error Code 3 - Stale Answer
     4.5.  Extended DNS Error Code 4 - Forged Answer
     4.6.  Extended DNS Error Code 5 - DNSSEC Indeterminate
     4.7.  Extended DNS Error Code 6 - DNSSEC Bogus
     4.8.  Extended DNS Error Code 7 - Signature Expired
     4.9.  Extended DNS Error Code 8 - Signature Not Yet Valid
     4.10. Extended DNS Error Code 9 - DNSKEY Missing
     4.11. Extended DNS Error Code 10 - RRSIGs Missing
     4.12. Extended DNS Error Code 11 - No Zone Key Bit Set
     4.13. Extended DNS Error Code 12 - NSEC Missing
     4.14. Extended DNS Error Code 13 - Cached Error
     4.15. Extended DNS Error Code 14 - Not Ready
     4.16. Extended DNS Error Code 15 - Blocked
     4.17. Extended DNS Error Code 16 - Censored
     4.18. Extended DNS Error Code 17 - Filtered
     4.19. Extended DNS Error Code 18 - Prohibited
     4.20. Extended DNS Error Code 19 - Stale NXDOMAIN Answer
     4.21. Extended DNS Error Code 20 - Not Authoritative
     4.22. Extended DNS Error Code 21 - Not Supported
     4.23. Extended DNS Error Code 22 - No Reachable Authority
     4.24. Extended DNS Error Code 23 - Network Error
     4.25. Extended DNS Error Code 24 - Invalid Data
   5.  IANA Considerations
     5.1.  A New Extended DNS Error Code EDNS Option
     5.2.  New Registry for Extended DNS Error Codes
   6.  Security Considerations
   7.  References
     7.1.  Normative References
     7.2.  Informative References
   Acknowledgements
   Authors' Addresses

1.  Introduction and Background

   There are many reasons that a DNS query may fail -- some of them
   transient, some permanent; some can be resolved by querying another
   server, some are likely best handled by stopping resolution.
   Unfortunately, the error signals that a DNS server can return are
   very limited and are not very expressive.  This means that
   applications and resolvers often have to "guess" at what the issue
   is, e.g., was the answer marked REFUSED because of a lame delegation
   or because the nameserver is still starting up and loading zones?  Is
   a SERVFAIL a DNSSEC validation issue, or is the nameserver
   experiencing some other failure?  What error messages should be
   presented to the user or logged under these conditions?

   A good example of issues that would benefit from additional error
   information are errors caused by DNSSEC validation issues.  When a
   stub resolver queries a name that is DNSSEC bogus [RFC8499] (using a
   validating resolver), the stub resolver receives only a SERVFAIL in
   response.  Unfortunately, the SERVFAIL Response Code (RCODE) is used
   to signal many sorts of DNS errors, and so the stub resolver's only
   option is to ask the next configured DNS resolver.  The result of
   trying the next resolver is one of two outcomes: either the next
   resolver also validates and a SERVFAIL is returned again or the next
   resolver is not a validating resolver and the user is returned a
   potentially harmful result.  With an Extended DNS Error (EDE) option
   enclosed in the response message, the resolver is able to return a
   more descriptive reason as to why any failures happened or add
   additional context to a message containing a NOERROR RCODE.

   This document specifies a mechanism to extend DNS errors to provide
   additional information about the cause of an error.  The Extended DNS
   Error codes described in this document can be used by any system that
   sends DNS queries and receives a response containing an EDE option.
   Different codes are useful in different circumstances, and thus
   different systems (stub resolvers, recursive resolvers, and
   authoritative resolvers) might receive and use them.

1.1.  Requirements Notation

   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
   "OPTIONAL" in this document are to be interpreted as described in
   BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all
   capitals, as shown here.

2.  Extended DNS Error EDNS0 Option Format

   This document uses an Extended Mechanism for DNS (EDNS0) [RFC6891]
   option to include Extended DNS Error (EDE) information in DNS
   messages.  The option is structured as follows:

                                                1   1   1   1   1   1
        0   1   2   3   4   5   6   7   8   9   0   1   2   3   4   5
      +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
   0: |                            OPTION-CODE                        |
      +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
   2: |                           OPTION-LENGTH                       |
      +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
   4: | INFO-CODE                                                     |
      +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
   6: / EXTRA-TEXT ...                                                /
      +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+


   Field definition details:

   OPTION-CODE:
      2 octets / 16 bits (defined in [RFC6891]) contains the value 15
      for EDE.

   OPTION-LENGTH:
      2 octets / 16 bits (defined in [RFC6891]) contains the length of
      the payload (everything after OPTION-LENGTH) in octets and should
      be 2 plus the length of the EXTRA-TEXT field (which may be a zero-
      length string).

   INFO-CODE:
      16 bits, which is the principal contribution of this document.
      This 16-bit value, encoded in network most significant bit (MSB)
      byte order, provides the additional context for the RESPONSE-CODE
      of the DNS message.  The INFO-CODE serves as an index into the
      "Extended DNS Errors" registry, defined and created in
      Section 5.2.

   EXTRA-TEXT:
      a variable-length, UTF-8-encoded [RFC5198] text field that may
      hold additional textual information.  This information is intended
      for human consumption (not automated parsing).  EDE text may be
      null terminated but MUST NOT be assumed to be; the length MUST be
      derived from the OPTION-LENGTH field.  The EXTRA-TEXT field may be
      zero octets in length, indicating that there is no EXTRA-TEXT
      included.  Care should be taken not to include private information
      in the EXTRA-TEXT field that an observer would not otherwise have
      access to, such as account numbers.

   The Extended DNS Error (EDE) option can be included in any response
   (SERVFAIL, NXDOMAIN, REFUSED, even NOERROR, etc.) to a query that
   includes an OPT pseudo-RR [RFC6891].  This document includes a set of
   initial codepoints but is extensible via the IANA registry defined
   and created in Section 5.2.

3.  Extended DNS Error Processing

   When the response grows beyond the requestor's UDP payload size
   [RFC6891], servers SHOULD truncate messages by dropping EDE options
   before dropping other data from packets.  Implementations SHOULD set
   the truncation bit when dropping EDE options.  Because long EXTRA-
   TEXT fields may trigger truncation (which is undesirable given the
   supplemental nature of EDE), implementers and operators creating EDE
   options SHOULD avoid lengthy EXTRA-TEXT contents.

   When a resolver or forwarder receives an EDE option, whether or not
   (and how) to pass along EDE information on to their original client
   is implementation dependent.  Implementations MAY choose to not
   forward information, or they MAY choose to create a new EDE option(s)
   that conveys the information encoded in the received EDE.  When doing
   so, the source of the error SHOULD be attributed in the EXTRA-TEXT
   field, since an EDNS0 option received by the original client will
   appear to have come from the resolver or forwarder sending it.

   This document does not allow or prohibit any particular extended
   error codes and information to be matched with any particular RCODEs.
   Some combinations of extended error codes and RCODEs may seem
   nonsensical (such as resolver-specific extended error codes received
   in responses from authoritative servers), so systems interpreting the
   extended error codes MUST NOT assume that a combination will make
   sense.  Receivers MUST be able to accept EDE codes and EXTRA-TEXT in
   all messages, including those with a NOERROR RCODE but need not act
   on them.  Applications MUST continue to follow requirements from
   applicable specifications on how to process RCODEs no matter what EDE
   values are also received.  Senders MAY include more than one EDE
   option and receivers MUST be able to accept (but not necessarily
   process or act on) multiple EDE options in a DNS message.

4.  Defined Extended DNS Errors

   This document defines some initial EDE codes.  The mechanism is
   intended to be extensible, and additional codepoints can be
   registered in the "Extended DNS Errors" registry (Section 5.2).  The
   INFO-CODE from the EDE EDNS option is used to serve as an index into
   the "Extended DNS Error" IANA registry, the initial values for which
   are defined in the following subsections.

4.1.  Extended DNS Error Code 0 - Other

   The error in question falls into a category that does not match known
   extended error codes.  Implementations SHOULD include an EXTRA-TEXT
   value to augment this error code with additional information.

4.2.  Extended DNS Error Code 1 - Unsupported DNSKEY Algorithm

   The resolver attempted to perform DNSSEC validation, but a DNSKEY
   RRset contained only unsupported DNSSEC algorithms.

4.3.  Extended DNS Error Code 2 - Unsupported DS Digest Type

   The resolver attempted to perform DNSSEC validation, but a DS RRset
   contained only unsupported Digest Types.

4.4.  Extended DNS Error Code 3 - Stale Answer

   The resolver was unable to resolve the answer within its time limits
   and decided to answer with previously cached data instead of
   answering with an error.  This is typically caused by problems
   communicating with an authoritative server, possibly as result of a
   denial of service (DoS) attack against another network.  (See also
   Code 19.)

4.5.  Extended DNS Error Code 4 - Forged Answer

   For policy reasons (legal obligation or malware filtering, for
   instance), an answer was forged.  Note that this should be used when
   an answer is still provided, not when failure codes are returned
   instead.  See Blocked (15), Censored (16), and Filtered (17) for use
   when returning other response codes.

4.6.  Extended DNS Error Code 5 - DNSSEC Indeterminate

   The resolver attempted to perform DNSSEC validation, but validation
   ended in the Indeterminate state [RFC4035].

4.7.  Extended DNS Error Code 6 - DNSSEC Bogus

   The resolver attempted to perform DNSSEC validation, but validation
   ended in the Bogus state.

4.8.  Extended DNS Error Code 7 - Signature Expired

   The resolver attempted to perform DNSSEC validation, but no
   signatures are presently valid and some (often all) are expired.

4.9.  Extended DNS Error Code 8 - Signature Not Yet Valid

   The resolver attempted to perform DNSSEC validation, but no
   signatures are presently valid and at least some are not yet valid.

4.10.  Extended DNS Error Code 9 - DNSKEY Missing

   A DS record existed at a parent, but no supported matching DNSKEY
   record could be found for the child.

4.11.  Extended DNS Error Code 10 - RRSIGs Missing

   The resolver attempted to perform DNSSEC validation, but no RRSIGs
   could be found for at least one RRset where RRSIGs were expected.

4.12.  Extended DNS Error Code 11 - No Zone Key Bit Set

   The resolver attempted to perform DNSSEC validation, but no Zone Key
   Bit was set in a DNSKEY.

4.13.  Extended DNS Error Code 12 - NSEC Missing

   The resolver attempted to perform DNSSEC validation, but the
   requested data was missing and a covering NSEC or NSEC3 was not
   provided.

4.14.  Extended DNS Error Code 13 - Cached Error

   The resolver is returning the SERVFAIL RCODE from its cache.

4.15.  Extended DNS Error Code 14 - Not Ready

   The server is unable to answer the query, as it was not fully
   functional when the query was received.

4.16.  Extended DNS Error Code 15 - Blocked

   The server is unable to respond to the request because the domain is
   on a blocklist due to an internal security policy imposed by the
   operator of the server resolving or forwarding the query.

4.17.  Extended DNS Error Code 16 - Censored

   The server is unable to respond to the request because the domain is
   on a blocklist due to an external requirement imposed by an entity
   other than the operator of the server resolving or forwarding the
   query.  Note that how the imposed policy is applied is irrelevant
   (in-band DNS filtering, court order, etc.).

4.18.  Extended DNS Error Code 17 - Filtered

   The server is unable to respond to the request because the domain is
   on a blocklist as requested by the client.  Functionally, this
   amounts to "you requested that we filter domains like this one."

4.19.  Extended DNS Error Code 18 - Prohibited

   An authoritative server or recursive resolver that receives a query
   from an "unauthorized" client can annotate its REFUSED message with
   this code.  Examples of "unauthorized" clients are recursive queries
   from IP addresses outside the network, blocklisted IP addresses,
   local policy, etc.

4.20.  Extended DNS Error Code 19 - Stale NXDOMAIN Answer

   The resolver was unable to resolve an answer within its configured
   time limits and decided to answer with a previously cached NXDOMAIN
   answer instead of answering with an error.  This may be caused, for
   example, by problems communicating with an authoritative server,
   possibly as result of a denial of service (DoS) attack against
   another network.  (See also Code 3.)

4.21.  Extended DNS Error Code 20 - Not Authoritative

   An authoritative server that receives a query with the Recursion
   Desired (RD) bit clear, or when it is not configured for recursion
   for a domain for which it is not authoritative, SHOULD include this
   EDE code in the REFUSED response.  A resolver that receives a query
   with the RD bit clear SHOULD include this EDE code in the REFUSED
   response.

4.22.  Extended DNS Error Code 21 - Not Supported

   The requested operation or query is not supported.

4.23.  Extended DNS Error Code 22 - No Reachable Authority

   The resolver could not reach any of the authoritative name servers
   (or they potentially refused to reply).

4.24.  Extended DNS Error Code 23 - Network Error

   An unrecoverable error occurred while communicating with another
   server.

4.25.  Extended DNS Error Code 24 - Invalid Data

   The authoritative server cannot answer with data for a zone it is
   otherwise configured to support.  Examples of this include its most
   recent zone being too old or having expired.

5.  IANA Considerations

5.1.  A New Extended DNS Error Code EDNS Option

   This document defines a new EDNS(0) option, entitled "Extended DNS
   Error", with the assigned value of 15 from the "DNS EDNS0 Option
   Codes (OPT)" registry:

           +=======+====================+==========+===========+
           | Value | Name               | Status   | Reference |
           +=======+====================+==========+===========+
           | 15    | Extended DNS Error | Standard | RFC 8914  |
           +-------+--------------------+----------+-----------+

                                  Table 1

5.2.  New Registry for Extended DNS Error Codes

   IANA has created and will maintain a new registry called "Extended
   DNS Error Codes" on the "Domain Name System (DNS) Parameters" web
   page as follows:

                +===============+=========================+
                | Range         | Registration Procedures |
                +===============+=========================+
                | 0 - 49151     | First Come First Served |
                +---------------+-------------------------+
                | 49152 - 65535 | Private Use             |
                +---------------+-------------------------+

                                  Table 2

   The "Extended DNS Error Codes" registry is a table with three
   columns: INFO-CODE, Purpose, and Reference.  The initial content is
   as below.

      +=============+==============================+===============+
      | INFO-CODE   | Purpose                      | Reference     |
      +=============+==============================+===============+
      | 0           | Other Error                  | Section 4.1   |
      +-------------+------------------------------+---------------+
      | 1           | Unsupported DNSKEY Algorithm | Section 4.2   |
      +-------------+------------------------------+---------------+
      | 2           | Unsupported DS Digest Type   | Section 4.3   |
      +-------------+------------------------------+---------------+
      | 3           | Stale Answer                 | Section 4.4   |
      |             |                              | and [RFC8767] |
      +-------------+------------------------------+---------------+
      | 4           | Forged Answer                | Section 4.5   |
      +-------------+------------------------------+---------------+
      | 5           | DNSSEC Indeterminate         | Section 4.6   |
      +-------------+------------------------------+---------------+
      | 6           | DNSSEC Bogus                 | Section 4.7   |
      +-------------+------------------------------+---------------+
      | 7           | Signature Expired            | Section 4.8   |
      +-------------+------------------------------+---------------+
      | 8           | Signature Not Yet Valid      | Section 4.9   |
      +-------------+------------------------------+---------------+
      | 9           | DNSKEY Missing               | Section 4.10  |
      +-------------+------------------------------+---------------+
      | 10          | RRSIGs Missing               | Section 4.11  |
      +-------------+------------------------------+---------------+
      | 11          | No Zone Key Bit Set          | Section 4.12  |
      +-------------+------------------------------+---------------+
      | 12          | NSEC Missing                 | Section 4.13  |
      +-------------+------------------------------+---------------+
      | 13          | Cached Error                 | Section 4.14  |
      +-------------+------------------------------+---------------+
      | 14          | Not Ready                    | Section 4.15  |
      +-------------+------------------------------+---------------+
      | 15          | Blocked                      | Section 4.16  |
      +-------------+------------------------------+---------------+
      | 16          | Censored                     | Section 4.17  |
      +-------------+------------------------------+---------------+
      | 17          | Filtered                     | Section 4.18  |
      +-------------+------------------------------+---------------+
      | 18          | Prohibited                   | Section 4.19  |
      +-------------+------------------------------+---------------+
      | 19          | Stale NXDomain Answer        | Section 4.20  |
      +-------------+------------------------------+---------------+
      | 20          | Not Authoritative            | Section 4.21  |
      +-------------+------------------------------+---------------+
      | 21          | Not Supported                | Section 4.22  |
      +-------------+------------------------------+---------------+
      | 22          | No Reachable Authority       | Section 4.23  |
      +-------------+------------------------------+---------------+
      | 23          | Network Error                | Section 4.24  |
      +-------------+------------------------------+---------------+
      | 24          | Invalid Data                 | Section 4.25  |
      +-------------+------------------------------+---------------+
      | 25-49151    | Unassigned                   |               |
      +-------------+------------------------------+---------------+
      | 49152-65535 | Reserved for Private Use     | Section 5.2   |
      +-------------+------------------------------+---------------+

                                 Table 3

6.  Security Considerations

   Though DNSSEC continues to be deployed, unfortunately a significant
   number of clients (~11% according to [GeoffValidation]) that receive
   a SERVFAIL from a validating resolver because of a DNSSEC validation
   issue will simply ask the next (potentially non-validating) resolver
   in their list and thus don't get the protections that DNSSEC should
   provide.

   EDE information is unauthenticated information, unless secured by a
   form of secured DNS transaction, such as [RFC2845], [RFC2931],
   [RFC8094], or [RFC8484].  An attacker (e.g., a man in the middle
   (MITM) or malicious recursive server) could insert an extended error
   response into untrusted data -- although, ideally, clients and
   resolvers would not trust any unauthenticated information.  As such,
   EDE content should be treated only as diagnostic information and MUST
   NOT alter DNS protocol processing.  Until all DNS answers are
   authenticated via DNSSEC or the other mechanisms mentioned above,
   there are some trade-offs.  As an example, an attacker who is able to
   insert the DNSSEC Bogus Extended Error into a DNS message could
   instead simply reply with a fictitious address (A or AAAA) record.
   Note that DNS RCODEs also contain no authentication and can be just
   as easily manipulated.

   By design, EDE potentially exposes additional information via DNS
   resolution processes that may leak information.  An example of this
   is the Prohibited EDE code (18), which may leak the fact that the
   name is on a blocklist.

7.  References

7.1.  Normative References

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119,
              DOI 10.17487/RFC2119, March 1997,
              <https://www.rfc-editor.org/info/rfc2119>.

   [RFC4035]  Arends, R., Austein, R., Larson, M., Massey, D., and S.
              Rose, "Protocol Modifications for the DNS Security
              Extensions", RFC 4035, DOI 10.17487/RFC4035, March 2005,
              <https://www.rfc-editor.org/info/rfc4035>.

   [RFC5198]  Klensin, J. and M. Padlipsky, "Unicode Format for Network
              Interchange", RFC 5198, DOI 10.17487/RFC5198, March 2008,
              <https://www.rfc-editor.org/info/rfc5198>.

   [RFC6891]  Damas, J., Graff, M., and P. Vixie, "Extension Mechanisms
              for DNS (EDNS(0))", STD 75, RFC 6891,
              DOI 10.17487/RFC6891, April 2013,
              <https://www.rfc-editor.org/info/rfc6891>.

   [RFC8174]  Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
              2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
              May 2017, <https://www.rfc-editor.org/info/rfc8174>.

   [RFC8499]  Hoffman, P., Sullivan, A., and K. Fujiwara, "DNS
              Terminology", BCP 219, RFC 8499, DOI 10.17487/RFC8499,
              January 2019, <https://www.rfc-editor.org/info/rfc8499>.

   [RFC8767]  Lawrence, D., Kumari, W., and P. Sood, "Serving Stale Data
              to Improve DNS Resiliency", RFC 8767,
              DOI 10.17487/RFC8767, March 2020,
              <https://www.rfc-editor.org/info/rfc8767>.

7.2.  Informative References

   [GeoffValidation]
              Huston, G., "A quick review of DNSSEC Validation in
              today's Internet", June 2016, <http://www.potaroo.net/
              presentations/2016-06-27-dnssec.pdf>.

   [RFC2845]  Vixie, P., Gudmundsson, O., Eastlake 3rd, D., and B.
              Wellington, "Secret Key Transaction Authentication for DNS
              (TSIG)", RFC 2845, DOI 10.17487/RFC2845, May 2000,
              <https://www.rfc-editor.org/info/rfc2845>.

   [RFC2931]  Eastlake 3rd, D., "DNS Request and Transaction Signatures
              ( SIG(0)s )", RFC 2931, DOI 10.17487/RFC2931, September
              2000, <https://www.rfc-editor.org/info/rfc2931>.

   [RFC8094]  Reddy, T., Wing, D., and P. Patil, "DNS over Datagram
              Transport Layer Security (DTLS)", RFC 8094,
              DOI 10.17487/RFC8094, February 2017,
              <https://www.rfc-editor.org/info/rfc8094>.

   [RFC8484]  Hoffman, P. and P. McManus, "DNS Queries over HTTPS
              (DoH)", RFC 8484, DOI 10.17487/RFC8484, October 2018,
              <https://www.rfc-editor.org/info/rfc8484>.

Acknowledgements

   The authors wish to thank Joe Abley, Mark Andrews, Tim April,
   Vittorio Bertola, Stephane Bortzmeyer, Vladimir Cunat, Ralph Dolmans,
   Peter DeVries, Peter van Dijk, Mats Dufberg, Donald Eastlake, Bob
   Harold, Paul Hoffman, Geoff Huston, Shane Kerr, Edward Lewis, Carlos
   M. Martinez, George Michelson, Eric Orth, Michael Sheldon, Puneet
   Sood, Petr Spacek, Ondrej Sury, John Todd, Loganaden Velvindron, and
   Paul Vixie.  They also vaguely remember discussing this with a number
   of people over the years but have forgotten who all of them were.
   Apologies if we forgot to acknowledge your contributions.

   One author also wants to thank the band Infected Mushroom for
   providing a good background soundtrack.  Another author would like to
   thank the band Mushroom Infectors.  This was funny at the time we
   wrote it, but we cannot remember why...

Authors' Addresses

   Warren Kumari
   Google
   1600 Amphitheatre Parkway
   Mountain View, CA 94043
   United States of America

   Email: warren@kumari.net


   Evan Hunt
   ISC
   950 Charter St
   Redwood City, CA 94063
   United States of America

   Email: each@isc.org


   Roy Arends
   ICANN

   Email: roy.arends@icann.org


   Wes Hardaker
   USC/ISI
   P.O. Box 382
   Davis, CA 95617
   United States of America

   Email: ietf@hardakers.net


   David C Lawrence
   Salesforce
   415 Mission St
   San Francisco, CA 94105
   United States of America

   Email: tale@dd.org

ISO Plain Language

On this page
PROBLEMA DNS server has very few ways to report failure. A SERVFAIL does not say whether the answer failed DNSSEC validation, whether the name is on a blocklist, or whether the server simply could not reach the authoritative server, so applications and resolvers have to guess.
MECHANISMRFC 8914 adds an EDNS0 option, code 15, that carries a 16-bit error code and optional human-readable text. The codes form a registry that covers DNSSEC validation failures, policy blocks, operational failures and stale cached answers.
WHY IT MATTERSA resolver or application that receives the option knows why the lookup failed, and can decide whether to try another server, warn the user, or log something useful. The information is diagnostic only and must not change how DNS is processed. The document is a Proposed Standard and has not been obsoleted.

§1Introduction and Background

There are many reasons a DNS query may fail: some are transient and some permanent; some can be resolved by querying another server, and some are best handled by stopping resolution. Unfortunately, the error signals a DNS server can return are very limited and not very expressive. Applications and resolvers often have to guess at the issue. Was the answer marked REFUSED because of a lame delegation, or because the nameserver is still starting up and loading zones? Is a SERVFAIL a DNSSEC validation issue, or is the nameserver experiencing some other failure? What error message should be presented to the user or logged in these conditions?

Errors caused by DNSSEC validation issues are a good example of what would benefit from more information. When a stub resolver queries a name that is DNSSEC bogus, using a validating resolver, the stub resolver receives only a SERVFAIL. The SERVFAIL Response Code is used to signal many sorts of DNS errors, so the stub resolver's only option is to ask the next configured DNS resolver. The result is one of two outcomes: either the next resolver also validates and a SERVFAIL is returned again, or the next resolver is not a validating resolver and the user is returned a potentially harmful result.

With an Extended DNS Error option enclosed in the response message, the resolver is able to return a more descriptive reason for why a failure happened, or to add additional context to a message containing a NOERROR RCODE. The Extended DNS Error codes described here can be used by any system that sends DNS queries and receives a response containing an EDE option. Different codes are useful in different circumstances, so different systems, such as stub resolvers, recursive resolvers and authoritative resolvers, might receive and use them.

DNS has one blunt failure code, and it means many different things. That is not just inconvenient for people reading logs. It makes a client behave badly: a stub resolver that gets SERVFAIL cannot tell whether the answer was rejected on security grounds, so it tries the next server, which may not validate at all.

§2The Extended DNS Error Option

The document uses an Extended Mechanism for DNS option to include Extended DNS Error information in DNS messages. The option is structured as a 16-bit OPTION-CODE, a 16-bit OPTION-LENGTH, a 16-bit INFO-CODE, and a variable-length EXTRA-TEXT field.

OPTION-CODE is two octets, or 16 bits, as defined in RFC 6891, and contains the value 15 for EDE. OPTION-LENGTH is two octets and contains the length of the payload, everything after the length field itself, in octets; it should be 2 plus the length of the EXTRA-TEXT field, which may be a zero-length string. INFO-CODE is 16 bits and is the principal contribution of the document. This 16-bit value, encoded in network most significant bit byte order, provides the additional context for the RESPONSE-CODE of the DNS message, and serves as an index into the Extended DNS Errors registry.

EXTRA-TEXT is a variable-length, UTF-8-encoded text field that may hold additional textual information. The information is intended for human consumption, not automated parsing. EDE text may be null terminated but must not be assumed to be, and the length must be derived from the OPTION-LENGTH field. The field may be zero octets long, indicating that there is no EXTRA-TEXT included. Care should be taken not to include private information in the EXTRA-TEXT field that an observer would not otherwise have access to, such as account numbers.

The EDE option can be included in any response, whether SERVFAIL, NXDOMAIN, REFUSED or even NOERROR, to a query that includes an OPT pseudo-record. The document includes a set of initial codepoints but is extensible through the IANA registry.

The option rides in the extra section of a DNS message, next to the other extension fields. It holds a two-octet number that says which kind of failure it is, and optionally a line of text for a human to read. The text may be empty, and it must not be assumed to end with a null character, because its length comes from the option length field.

The EDE EDNS0 option, fixed part; the variable EXTRA-TEXT follows (RFC 8914)
Extended DNS Error option
FieldNameSizeValueDescription
OPTION-CODEOPTION-CODE2 bytes15The EDNS0 option code, 15 for Extended DNS Error.
OPTION-LENGTHOPTION-LENGTH2 bytesLength of the payload after this field, that is 2 plus the length of EXTRA-TEXT.
INFO-CODEINFO-CODE2 bytesThe error code, an index into the Extended DNS Errors registry.

§3Extended DNS Error Processing

When a response grows beyond the requestor's UDP payload size, servers should truncate messages by dropping EDE options before dropping other data from packets, and should set the truncation bit when dropping EDE options. Because long EXTRA-TEXT fields may trigger truncation, which is undesirable given the supplemental nature of EDE, implementers and operators creating EDE options should avoid lengthy EXTRA-TEXT contents.

When a resolver or forwarder receives an EDE option, whether and how to pass the information along to its original client is implementation dependent. Implementations may choose not to forward it, or may choose to create new EDE options that convey the information encoded in the received one. When doing so, the source of the error should be attributed in the EXTRA-TEXT field, since an EDNS0 option received by the original client will appear to have come from the resolver or forwarder that sent it.

The document does not allow or prohibit any particular extended error codes and information being matched with any particular RCODEs. Some combinations may seem nonsensical, such as resolver-specific extended error codes received in responses from authoritative servers, so systems interpreting the codes must not assume that a combination will make sense. Receivers must be able to accept EDE codes and EXTRA-TEXT in all messages, including those with a NOERROR RCODE, but need not act on them. Applications must continue to follow the requirements of applicable specifications on how to process RCODEs no matter what EDE values are also received. Senders may include more than one EDE option, and receivers must be able to accept, though not necessarily process or act on, multiple EDE options in a DNS message.

Two rules matter for anyone building on this. The option must never change how a response is treated: the ordinary response code still decides what happens. And a middle server that rewrites the option should say where the error really came from, because the client will otherwise think the error came from it.

§4Defined Extended DNS Errors

The document defines the initial set of EDE codes, from 0 to 24. The mechanism is intended to be extensible, and additional codepoints can be registered in the Extended DNS Errors registry.

Code 0, Other, covers an error that falls into no known category; implementations should include an EXTRA-TEXT value to augment it. Code 1, Unsupported DNSKEY Algorithm, means the resolver tried to validate but a DNSKEY RRset contained only unsupported DNSSEC algorithms. Code 2, Unsupported DS Digest Type, means the same for a DS RRset with only unsupported digest types.

Code 3, Stale Answer, means the resolver could not resolve within its time limits and answered with previously cached data instead of an error, typically because of problems communicating with an authoritative server, possibly as a result of a denial of service attack against another network. Code 4, Forged Answer, means an answer was forged for policy reasons, such as a legal obligation or malware filtering; it should be used when an answer is still provided, not when a failure code is returned instead.

Codes 5 to 12 cover DNSSEC validation. Code 5, DNSSEC Indeterminate, means validation ended in the Indeterminate state. Code 6, DNSSEC Bogus, means it ended in the Bogus state. Code 7, Signature Expired, means no signatures are presently valid and some, often all, are expired. Code 8, Signature Not Yet Valid, means no signatures are presently valid and at least some are not yet valid. Code 9, DNSKEY Missing, means a DS record existed at a parent but no supported matching DNSKEY record could be found for the child. Code 10, RRSIGs Missing, means no RRSIGs could be found for at least one RRset where they were expected. Code 11, No Zone Key Bit Set, means no Zone Key Bit was set in a DNSKEY. Code 12, NSEC Missing, means the requested data was missing and a covering NSEC or NSEC3 was not provided.

Code 13, Cached Error, means the resolver is returning the SERVFAIL RCODE from its cache. Code 14, Not Ready, means the server could not answer because it was not fully functional when the query was received.

Codes 15 to 18 cover policy decisions. Code 15, Blocked, means the server cannot respond because the domain is on a blocklist due to an internal security policy imposed by the operator of the server. Code 16, Censored, means the same but because of an external requirement imposed by an entity other than the operator; how the policy is applied, whether in-band filtering or a court order, is irrelevant. Code 17, Filtered, means the server cannot respond because the domain is on a blocklist as requested by the client. Code 18, Prohibited, is for an authoritative server or recursive resolver that receives a query from an unauthorized client, such as a recursive query from an IP address outside the network, a blocklisted address, or one that local policy forbids, and annotates its REFUSED message with the code.

Code 19, Stale NXDOMAIN Answer, means the resolver could not resolve an answer within its configured time limits and answered with a previously cached NXDOMAIN answer instead of an error. Code 20, Not Authoritative, is for an authoritative server that receives a query with the Recursion Desired bit clear, or that is not configured for recursion for a domain for which it is not authoritative, and for a resolver that receives a query with the RD bit clear.

Code 21, Not Supported, means the requested operation or query is not supported. Code 22, No Reachable Authority, means the resolver could not reach any of the authoritative name servers, or they potentially refused to reply. Code 23, Network Error, means an unrecoverable error occurred while communicating with another server. Code 24, Invalid Data, means the authoritative server cannot answer with data for a zone it is otherwise configured to support, for example because its most recent zone is too old or has expired.

The 25 codes fall into a few families. A validation failure has its own set of codes, one for each way DNSSEC can fail, so an operator can tell a missing DNSKEY from an expired signature. A block gets three codes depending on who imposed it: the operator, an outside authority, or the client. And there are operational codes for a server that was not ready, could not reach the authority, or holds data that is too old.

The DNSSEC-related Extended DNS Error codes
  • 1Unsupported DNSKEY Algorithm — Validation was attempted but the DNSKEY RRset held only unsupported algorithms.
  • 2Unsupported DS Digest Type — Validation was attempted but the DS RRset held only unsupported digest types.
  • 5DNSSEC Indeterminate — Validation ended in the Indeterminate state.
  • 6DNSSEC Bogus — Validation ended in the Bogus state.
  • 7Signature Expired — No signatures are presently valid and some, often all, are expired.
  • 8Signature Not Yet Valid — No signatures are presently valid and at least some are not yet valid.
  • 9DNSKEY Missing — A DS record existed at a parent but no supported matching DNSKEY was found for the child.
  • 10RRSIGs Missing — No RRSIGs could be found for at least one RRset where they were expected.
  • 11No Zone Key Bit Set — No Zone Key Bit was set in a DNSKEY.
  • 12NSEC Missing — The requested data was missing and a covering NSEC or NSEC3 was not provided.
The families of Extended DNS Error code
  • DNSSEC validationCodes 1, 2 and 5 to 12: the resolver tried to validate the answer and could not.
  • Policy and blockingCodes 15, 16, 17 and 18: the name is on a blocklist imposed by the operator, by an outside authority, or by the client.
  • Operational problemsCodes 14, 21, 22, 23 and 24: the server was not ready, the operation is not supported, no authority could be reached, a network error occurred, or the data is too old.
  • Cache and stale answersCodes 3, 13 and 19: the resolver answered from its cache because it could not get a fresh answer.

§5IANA Considerations

A new EDNS0 option is defined, entitled Extended DNS Error, with the assigned value 15 from the DNS EDNS0 Option Codes registry, with status Standard.

A new registry is created and maintained, called Extended DNS Error Codes, on the Domain Name System Parameters page. The range 0 to 49151 is First Come First Served, and the range 49152 to 65535 is Private Use. The registry is a table with three columns, INFO-CODE, Purpose and Reference, and its initial content is the 25 codes defined in the document, with the range 25 to 49151 unassigned.

One new option number is reserved for the mechanism, and a new registry is created for the error codes, with the upper half left for private use so that an organisation can use its own codes without touching the shared list.

§6Security Considerations

Although DNSSEC continues to be deployed, a significant number of clients, around 11% according to the cited survey, that receive a SERVFAIL from a validating resolver because of a DNSSEC validation issue will simply ask the next, potentially non-validating, resolver in their list, and thus do not get the protections DNSSEC should provide.

EDE information is unauthenticated unless secured by a form of secured DNS transaction, such as TSIG, SIG(0), DNS over DTLS or DNS over HTTPS. An attacker, for example a man in the middle or a malicious recursive server, could insert an extended error response into untrusted data, although ideally clients and resolvers would not trust any unauthenticated information. EDE content should be treated only as diagnostic information and must not alter DNS protocol processing. Until all DNS answers are authenticated, there are trade-offs: an attacker able to insert the DNSSEC Bogus error into a DNS message could instead simply reply with a fictitious address record. Note that DNS RCODEs also contain no authentication and can be just as easily manipulated.

By design, EDE potentially exposes additional information through the DNS resolution process that may leak information. An example is the Prohibited code, which may leak the fact that a name is on a blocklist.

The extra information is not authenticated, so anyone who can tamper with DNS traffic could put a false reason in it. That is why it must never change how a query is answered: a liar gains nothing by adding a note to a response, because the real response code still says what happened. A second point is that a blocklist reason can itself be a leak, since it tells an observer that a name was listed.

§7References