Network Working GroupInternet Engineering Task Force (IETF) J. AbleyInternet-DraftRequest for Comments: 8482 Afilias Updates: 1034, 1035(if approved)O. GudmundssonIntended status:Category: Standards Track M. MajkowskiExpires: February 15, 2019ISSN: 2070-1721 Cloudflare Inc. E. Hunt ISCAugust 14, 2018January 2019 Providing Minimal-Sized Responses to DNS Queriesthat haveThat Have QTYPE=ANYdraft-ietf-dnsop-refuse-any-07Abstract The Domain Name System (DNS) specifies a query type (QTYPE) "ANY". The operator of an authoritative DNS server might choose not to respond to such queries for reasons of local policy, motivated by security,performanceperformance, or other reasons. The DNS specification does not include specific guidance for thebehaviourbehavior of DNS servers or clients in this situation. This document aims to provide such guidance. This document updatesRFCRFCs 1034 andRFC1035. Status of This Memo ThisInternet-Draftissubmitted in full conformance with the provisions of BCP 78 and BCP 79. Internet-Drafts are working documentsan Internet Standards Track document. This document is a product of the Internet Engineering Task Force (IETF).Note that other groups may also distribute working documents as Internet-Drafts. The listIt represents the consensus ofcurrent Internet- Drafts is at https://datatracker.ietf.org/drafts/current/. Internet-Drafts are draft documents validthe IETF community. It has received public review and has been approved fora maximumpublication 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 ofsix monthsthis document, any errata, and how to provide feedback on it may beupdated, replaced, or obsoleted by other documentsobtained atany time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." This Internet-Draft will expire on February 15, 2019.https://www.rfc-editor.org/info/rfc8482. Copyright Notice Copyright (c)20182019 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. . . . . . . . . . . . . . . . . . . . . . . . 3....................................................3 1.1. Terminology. . . . . . . . . . . . . . . . . . . . . . . 3................................................3 2. Motivations for Use of ANY Queries. . . . . . . . . . . . . 3..............................3 3. General Approach. . . . . . . . . . . . . . . . . . . . . . 4................................................4 4.BehaviourBehavior of DNS Responders. . . . . . . . . . . . . . . . . 4......................................5 4.1. Answer with a Subset of AvailableRRSets . . . . . . . . 5RRsets ...................5 4.2. Answer with aSynthesisedSynthesized HINFORRSet . . . . . . . . . . 5RRset ......................5 4.3. Answer with Best Guess as to Intention. . . . . . . . . 6.....................6 4.4.Behaviour with TCPTransport. . . . . . . . . . . . . . 6Considerations ...................................6 5.BehaviourBehavior of DNS Initiators. . . . . . . . . . . . . . . . . 6......................................7 6. HINFO Considerations. . . . . . . . . . . . . . . . . . . . 7............................................7 7. Updates toRFCRFCs 1034 andRFC1035. . . . . . . . . . . . . . 7...................................7 8. Implementation Experience. . . . . . . . . . . . . . . . . . 8.......................................8 9. Security Considerations. . . . . . . . . . . . . . . . . . . 8.........................................8 10. IANA Considerations. . . . . . . . . . . . . . . . . . . . . 8............................................9 11.Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 8 12.References. . . . . . . . . . . . . . . . . . . . . . . . . 9 12.1......................................................9 11.1. Normative References. . . . . . . . . . . . . . . . . . 9 12.2.......................................9 11.2. Informative References. . . . . . . . . . . . . . . . . 9 12.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Appendix A. Editorial Notes . . . . . . . . . . . . . . . . . . 10 A.1. Change History . . . . . . . . . . . . . . . . . . . . . 10 A.1.1. draft-ietf-dnsop-refuse-any-07 . . . . . . . . . . . 10 A.1.2. draft-ietf-dnsop-refuse-any-06 . . . . . . . . . . . 10 A.1.3. draft-ietf-dnsop-refuse-any-05 . . . . . . . . . . . 10 A.1.4. draft-ietf-dnsop-refuse-any-04 . . . . . . . . . . . 10 A.1.5. draft-ietf-dnsop-refuse-any-03 . . . . . . . . . . . 10 A.1.6. draft-ietf-dnsop-refuse-any-02 . . . . . . . . . . . 10 A.1.7. draft-ietf-dnsop-refuse-any-01 . . . . . . . . . . . 11 A.1.8. draft-ietf-dnsop-refuse-any-00 . . . . . . . . . . . 11 A.1.9. draft-jabley-dnsop-refuse-any-01 . . . . . . . . . . 11 A.1.10. draft-jabley-dnsop-refuse-any-00 . . . . . . . . . . 11....................................9 Acknowledgements ..................................................10 Authors' Addresses. . . . . . . . . . . . . . . . . . . . . . . 11................................................10 1. Introduction The Domain Name System (DNS) specifies a query type (QTYPE) "ANY". The operator of an authoritative DNS server might choose not to respond to such queries for reasons of local policy, motivated by security,performanceperformance, or other reasons. The DNS specification [RFC1034] [RFC1035] does not include specific guidance for thebehaviourbehavior of DNS servers or clients in this situation. This document aims to provide such guidance. 1.1. Terminology This document uses terminology specific to the Domain Name System (DNS), descriptions of which can be found in[RFC7719].[RFC8499]. [RFC1035] defined type 255 to be "*". However, DNS implementations commonly use the keyword "ANY" to refer to that type code; this document follows that common usage. In this document, "ANYQuery"query" refers to a DNS meta-query with QTYPE=ANY. An "ANYResponse"response" is a response to such a query. In this document, "conventional ANY response" means an ANY response that is constructed in accordance with the algorithm documented insectionSection 4.3.2 of [RFC1034] and specifically without implementing any of the mechanisms described in this document. In an exchange of DNS messages between two hosts, this document refers to the host sending a DNS request as theinitiator,"initiator" and the host sending a DNS response as theresponder."responder". 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. Motivations for Use of ANY Queries ANY queries are legitimately used for debugging and checking the state of a DNS server for a particular name. ANY queries are sometimes used asaan attempt to reduce the number of queries needed to get information,e.g.e.g., to obtain MX,AA, and AAAARRSetsresource record sets (RRsets) for a mail domain in a single query.ThereHowever, there is no documented guidance available for this use case,however,and some implementations have been observed not to function asperhapstheir developers expected.Implementers thatIf implementers assume that an ANY query will ultimately be received by an authoritative server and will fetch all existingRRSets,RRsets, they should include a fallback mechanism to use when that does not happen. ANY queries are frequently used to exploit the amplification potential of DNSservers/resolversservers and resolvers using spoofed source addresses and UDP transport (see [RFC5358]). Having the ability to return small responses to such queries makes DNS servers less attractive amplifiers. ANY queries are sometimes used to help mine authoritative-only DNS servers for zone data, since they are expected to return allRRSetsRRsets for a particular query name. IfaDNSoperator prefersoperators prefer to reduce the potential for information leaks, they might choose not to send large ANY responses. Some authoritative-only DNS server implementations require additional processing in order to send a conventional ANYresponse, andresponse; avoiding that processing expense might be desirable. 3. General Approach This proposal provides a mechanism for anauthorityauthoritative DNS server to signal that conventional ANY queries are not supported for a particularQNAME, and to doQNAME. It does so insucha way that is both compatible with and triggers desirablebehaviourbehavior by unmodified clients(e.g.(e.g., DNS resolvers). Alternative proposals for dealing with ANY queries have been discussed. One approachproposedproposes using a new RCODE to signal that an authoritative server did not answer ANY queries in the standard way. This approach was found to have an undesirable effect on both resolvers and authoritative-only servers; resolvers receiving an unknown RCODE wouldre-sendresend the same query to all available authoritativeservers,servers rather than suppress futuresuchANY queries for the same QNAME.ThisThe proposal described in this document avoids that outcome by returning a non-emptyRRSetRRset in the ANY response,providingwhich provides resolvers with something to cache and effectivelysuppressingsuppresses repeat queries to the same or differentauthorityauthoritative DNS servers. 4.BehaviourBehavior of DNS Responders Below are the three different modes ofbehaviourbehavior by DNS responders when processing queries with QNAMEs that exist,QCLASS=INQCLASS=IN, and QTYPE=ANY.Operators/ImplementersOperators and implementers are free to choose whichever mechanism best suits their environment. 1. A DNS responder can choose to select one or a larger subset of the availableRRSetsRRsets at the QNAME. 2. A DNS responder can return asynthesisedsynthesized HINFO resource record. See Section 6 for discussion of the use of HINFO. 3.ResolverA resolver can try to give out the most likely records the requester wants. This is not alwayspossiblepossible, and the result might well be a large response. Except as described below in this section, the DNS responder MUST follow the standard algorithms when constructing a response. 4.1. Answer with a Subset of AvailableRRSetsRRsets A DNS responderwhichthat receives an ANY query MAY decline to provide a conventional ANYresponse,response or MAY instead send a response with a singleRRSetRRset (or a larger subset of availableRRSets)RRsets) in the answer section. TheRRSetsRRsets returned in the answer section of the response MAY consist of a singleRRSetRRset owned by the name specified in the QNAME. Where multipleRRSetsRRsets exist, the responder SHOULD choose a small subset of thoseavialableavailable to reduce the amplification potential of the response. If the zone is signed, appropriate RRSIG records MUST be included in the answer. Note that this mechanism does not provide anysignallingsignaling to indicate to a client that an incomplete subset of the availableRRSetsRRsets has been returned. 4.2. Answer with aSynthesisedSynthesized HINFORRSetRRset If there is no CNAME present at the owner name matching the QNAME, the resource record returned in the response MAY instead besynthesised, in which casesynthesized. In this case, a single HINFO resource record SHOULD be returned. The CPU field of the HINFO RDATA SHOULD be set toRFCXXXX [note to RFC Editor, replace with RFC number assigned to this document]."RFC8482". The OS field of the HINFO RDATA SHOULD be set to the null string to minimize the size of the response. The TTL encoded for thesynthesisedsynthesized HINFORRresource record SHOULD be chosen by the operator of the DNS responder to be large enough to suppress frequent subsequent ANY queries from the same initiator with the same QNAME, understanding that a TTL that is too long might make policy changes relating to ANY queries difficult to change in the future. The specific value usedis hence aSHOULD be configurable by the operator of the nameserver according to local policy, based on the familiarbalance whenconsiderations involved in choosing a TTL value for anyRRresource record in anyzone, and be specified according to local policy.zone. If the DNS query includes DO=1 and the QNAME corresponds to a zone that is known by the responder to be signed, a valid RRSIG for theRRSetsRRsets in the answer (or authority if answer is empty) section MUST be returned. In the case of DO=0, the RRSIG SHOULD be omitted. A system that receives an HINFO response SHOULD NOT infer that the response was generated according to this specification and apply any special processing of theresponse, sinceresponse because, ingeneralgeneral, it is not possible to tell with certainty whether the HINFORRSetRRset received wassynthesised.synthesized. In particular, systems SHOULD NOT rely upon the HINFO RDATA described in thisseectionsection to distinguish betweensynthesisedsynthesized andnon-synthesisednon-synthesized HINFORRSets.RRsets. 4.3. Answer with Best Guess as to Intention In somecasescases, it is possible to guess what the initiator wants in the answer (but not always). Some implementations have implemented the spirit of this document by returning allRRSetsRRsets ofRRTypeRRTYPE CNAME, MX,AA, and AAAA that are present at the owner namebutwhile suppressing others. This heuristic seems to work well inpractice, satisfyingpractice; it satisfies the needs of some applications whilst suppressing otherRRSetsRRsets such as TXT and DNSKEY that can often contribute to large responses. Whilst some applications may be satisfied by thisbehaviour,behavior, the resulting responses in the general case are larger than in the approaches described inSectionSections 4.1 andSection4.2. As before, if the zone is signed and the DO bit is set on the corresponding query, an RRSIGRRSetRRset MUST be included in the response. 4.4.Behaviour with TCPTransport Considerations A DNS responder MAY behave differently when processing ANY queries received over differenttransport, e.g.transports, e.g., by providing a conventional ANY response over TCP whilst using one of the other mechanisms specified in this document in the case where a query was received using UDP. ImplementersSHOULDMAY provide configuration options to allow operators to specify differentbehaviourbehavior overUDP and TCP.different transports. 5.BehaviourBehavior of DNS Initiators A DNS initiatorwhichthat sends a query with QTYPE=ANY and receives a response containing an HINFO resource record or a single RRset, as described in Section 4, MAY cache the response in the normal way. Such cached resource records SHOULD be retained in the cache following normal caching semantics, asit wouldwith any other response received from a DNS responder. A DNS initiator MAY suppress queries with QTYPE=ANY in the event that the local cache contains a matching HINFO resource record withRDATA.CPU field,the CPU field of the HINFO RDATA, as described in Section 4. A DNS initiator MAY instead respond to such queries with the contents of the local cache in the usual way. 6. HINFO Considerations It is possible that thesynthesisedsynthesized HINFORRSetRRset in an ANY response, once cached by the initiator, might suppress subsequent queries from the same initiator with QTYPE=HINFO.ThusThus, the use of HINFO in this proposal wouldhence haveeffectively mask the HINFORRSetRRset present in the zone.Authority-server operatorsOperators of authoritative servers who serve zones that rely upon conventional use of the HINFO RRTYPE SHOULD sensibly choose the "single RRset" method described in this document or select another type. The HINFO RRTYPE is believed to be rarely used in the DNS at the time of writing, based on observations made in passive DNS and at recursiveservers, authority serversandin passive DNS.authoritative DNS servers. 7. Updates toRFCRFCs 1034 andRFC1035 This document extends the specification for processing ANY queries described insectionSection 4.3.2 of [RFC1034]. It is important to note that returning a subset of availableRRSetsRRsets when processing an ANY query is legitimate and consistent with [RFC1035]; it can be argued that ANY does not always mean ALL, as used insectionSection 3.2.3 of [RFC1035]. The main difference here is that the TC bit SHOULD NOT be setonin theresponseresponse, thus indicating that this is not a complete answer. This document describes optionalbehaviourbehavior for both DNS initiators andresponders, andresponders; implementation of the guidance provided by this document is OPTIONAL. RRSIG queries(i.e.(i.e., queries with QTYPE=RRSIG) are similar to ANY queries in the sense that they have the potential to generate large responses as well as extra work for the responders that process them,e.g.e.g., in the case where signatures are generatedon-the-fly.on the fly. RRSIGRRSetsRRsets are not usually obtained using such explicitqueries,queries but are rather included in the responses for otherRRSetsRRsets that the RRSIGs cover. This document does not specify appropriatebehaviourbehavior for RRSIGqueries, but note thatqueries; however, future such advice might well benefit from consistency with and experienceofwith the approaches for ANY queries described here. 8. Implementation Experience In October20152015, the CloudflareAuthoritative Name serverauthoritative nameserver implementation implemented the HINFO response. A few minor problems were reported and have since been resolved. An implementation of the subset-mode response to ANY queries was implemented in NSD 4.1 in 2016. An implementation of a singleRRSetRRset response to an ANY query was made for BIND9 by Tony Finch, and that functionality was subsequently made available in production releases starting in BIND 9.11. 9. Security Considerations Queries with QTYPE=ANY are frequently observed as part of reflection attacks, since a relatively small query can be used to elicit a largeresponse; thisresponse. This is a desirable characteristic if the goal is to maximize the amplification potential of a DNS server as part of a volumetric attack. The ability of a DNS operator to suppress such responses on a particular server makes that server a less useful amplifier. The optionalbehaviourbehavior described in this document to reduce the size of responses to queries with QTYPE=ANY is compatible with the use of DNSSEC by both initiator and responder. 10. IANA ConsiderationsTheIANAis requested to updatehas updated theResourcefollowing entry in the "Resource Record (RR)TYPEs Registry [1] entry as follows:TYPEs" registry [RR_TYPES]: +------+-------+-------------------------------+--------------------+ |TypeTYPE | Value | Meaning | Reference | +------+-------+-------------------------------+--------------------+ | * | 255 | A request for some or all | [RFC1035][RFC6895] | | | | records the server has |[This Document][RFC8482] | | | | available | | +------+-------+-------------------------------+--------------------+ 11.Acknowledgements David Lawrence provided valuable observations and concrete suggestions. Jeremy Laidman helped make the document better. Tony Finch realized that this document was valuable and implemented it while under attack. Richard Gibson identified areas where more detail and accuracy was useful. A large number of other people also provided comments and suggestions we thank them all for the feedback. 12.References12.1.11.1. Normative References [RFC1034] Mockapetris, P., "Domain names - concepts and facilities", STD 13, RFC 1034, DOI 10.17487/RFC1034, November 1987, <https://www.rfc-editor.org/info/rfc1034>. [RFC1035] Mockapetris, P., "Domain names - implementation and specification", STD 13, RFC 1035, DOI 10.17487/RFC1035, November 1987, <https://www.rfc-editor.org/info/rfc1035>. [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>. [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>.12.2.11.2. Informative References [RFC5358] Damas, J. and F. Neves, "Preventing Use of Recursive Nameservers in Reflector Attacks", BCP 140, RFC 5358, DOI 10.17487/RFC5358, October 2008, <https://www.rfc-editor.org/info/rfc5358>. [RFC6895] Eastlake 3rd, D., "Domain Name System (DNS) IANA Considerations", BCP 42, RFC 6895, DOI 10.17487/RFC6895, April 2013, <https://www.rfc-editor.org/info/rfc6895>.[RFC7719][RFC8499] Hoffman, P., Sullivan, A., and K. Fujiwara, "DNS Terminology", BCP 219, RFC7719,8499, DOI10.17487/RFC7719, December 2015, <https://www.rfc-editor.org/info/rfc7719>. 12.3. URIs [1] http://www.iana.org/assignments/dns-parameters/dns- parameters.xhtml#dns-parameters-4 Appendix A. Editorial Notes This section (and sub-sections) to be removed prior to publication. A.1. Change History A.1.1. draft-ietf-dnsop-refuse-any-07 Address AD's concerns: more colour to describe updates to 1034/1035 in the abstract; don't rely upon HINFO RDATA formatting; language cleanup around guess intent. Add Evan as author (originator of the "choose one record" response idea). A.1.2. draft-ietf-dnsop-refuse-any-06 Update RFC 1034 as well as RFC 1035; define the term "conventional ANY response"; soften10.17487/RFC8499, January 2019, <https://www.rfc-editor.org/info/rfc8499>. [RR_TYPES] IANA, "Domain Name System (DNS) Parameters", <https://www.iana.org/assignments/dns-parameters>. Acknowledgements David Lawrence provided valuable observations andqualify ANY does not mean ALL; note that the subset mode response lacks signalling. A.1.3. draft-ietf-dnsop-refuse-any-05 Minor editorial changes. Soften advice on RRSIG queries. Version bump. A.1.4. draft-ietf-dnsop-refuse-any-04 These areconcrete suggestions. Jeremy Laidman helped make thechanges requested during WGLC. The title has been updated for readability The behavior section now contains description of three different approaches in order of preference. Text added on behavior over TCP. Thedocumentis clear in howbetter. Tony Finch realized that this document was valuable and implemented itupdates from RFC1035. Minor adjustments for readability and remove redundancy. A.1.5. draft-ietf-dnsop-refuse-any-03 Change section name to "Updates to RFC1034", few minor grammar changes suggested by Matthew Pounsettwhile under attack. Richard Gibson identified areas where more detail andTony Finch. Text clarifications, reflecting experience, added implementation experience. A.1.6. draft-ietf-dnsop-refuse-any-02 Added suggestion to call out RRSIG is optional when DO=0. Number of text suggestions from Jeremy Laidman. A.1.7. draft-ietf-dnsop-refuse-any-01 Add IANA Considerations A.1.8. draft-ietf-dnsop-refuse-any-00 Re-submitted with a different name following adoption at the dnsop WG meeting convened at IETF 94. A.1.9. draft-jabley-dnsop-refuse-any-01 Make signing of RRSets in answers from signed zones mandatory. Document the option of returning an existing RRSet in placeaccuracy were useful. A large number ofa synthesised one. A.1.10. draft-jabley-dnsop-refuse-any-00 Initial draft circulatedother people also provided comments and suggestions; we thank them all forcomment.the feedback. Authors' Addresses Joe Abley Afilias 300-184 York Street London, ON N6A 1B5 Canada Phone: +1 519 670 9327 Email: jabley@afilias.info Olafur Gudmundsson Cloudflare Inc. Email: olafur+ietf@cloudflare.com Marek Majkowski Cloudflare Inc. Email: marek@cloudflare.com Evan Hunt ISC 950 Charter St Redwood City, CA 94063USAUnited States of America Email: each@isc.org