<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc version 1.7.29 (Ruby 3.2.3) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-li-any-responses-minimization-00" category="std" consensus="true" submissionType="IETF" xml:lang="en" version="3">
  <!-- xml2rfc v2v3 conversion 3.31.0 -->
  <front>
    <title abbrev="ANY-Responses Minimization">Minimizing ANY-Query Responses at Recursive Resolvers</title>
    <seriesInfo name="Internet-Draft" value="draft-li-any-responses-minimization-00"/>
    <author initials="Z." surname="Li" fullname="Zihan Li">
      <organization>Chinese Academy of Sciences</organization>
      <address>
        <postal>
          <city>Beijing</city>
          <country>China</country>
        </postal>
        <email>lizihan24z@ict.ac.cn</email>
      </address>
    </author>
    <author initials="W." surname="Wu" fullname="Wenhao Wu">
      <organization>Chinese Academy of Sciences</organization>
      <address>
        <postal>
          <city>Beijing</city>
          <country>China</country>
        </postal>
        <email>wuwenhao22s@ict.ac.cn</email>
      </address>
    </author>
    <author initials="J." surname="Yan" fullname="Jin Yan">
      <organization>China Internet Network Information Center</organization>
      <address>
        <postal>
          <city>Beijing</city>
          <country>China</country>
        </postal>
        <email>yanjin@cnnic.cn</email>
      </address>
    </author>
    <author initials="Z." surname="Li" fullname="Zhenyu Li">
      <organization>Chinese Academy of Sciences</organization>
      <address>
        <postal>
          <city>Beijing</city>
          <country>China</country>
        </postal>
        <email>zyli@ict.ac.cn</email>
      </address>
    </author>
    <author initials="Z." surname="Yan" fullname="Zhiwei Yan">
      <organization>China Internet Network Information Center</organization>
      <address>
        <postal>
          <city>Beijing</city>
          <country>China</country>
        </postal>
        <email>yanzhiwei@cnnic.cn</email>
      </address>
    </author>
    <date year="2025" month="December" day="24"/>
    <area>Ops &amp; Management</area>
    <workgroup>Domain Name System Operations</workgroup>
    <keyword>DNS</keyword>
    <keyword>ANY-Query</keyword>
    <abstract>
      <?line 66?>

<t>The " ANY " query type in DNS requests the server to return all available resource records for a given domain name. While RFC 8482 defines a mechanism for authoritative servers to minimize ANY responses, a recursive resolver may still generate an ANY query response directly from its cache, thereby bypassing the authoritative side's ANY query minimization strategy. This document provides supplementary guidance for recursive resolvers on processing ANY queries to mitigate potential operational and security issues.</t>
    </abstract>
  </front>
  <middle>
    <?line 70?>

<section anchor="intro">
      <name>Introduction</name>
      <t>The Domain Name System (DNS) specifies a query type known as the "ANY "query (QTYPE=255). In operational deployments, the handling of ANY queries may raise both operational and security considerations. <xref target="RFC8482"/> defines a mechanism for authoritative servers to provide minimized responses to ANY queries; however, recursive resolvers may generate ANY responses directly from cached resource record sets (RRsets), thereby bypassing the minimization performed by authoritative servers. As a result, authoritative-side minimization alone does not fully mitigate the security risks posed by ANY queries. This document supplements existing mechanisms by providing guidance on response-minimization strategies for recursive resolvers when processing ANY queries.</t>
      <section anchor="terminology">
        <name>Terminology</name>
        <t>This document uses terminology specific to the Domain Name System (DNS), descriptions of which can be found in <xref target="RFC8499"/>.</t>
        <t>This document uses the term "ANY query" for DNS meta-queries that specify QTYPE=ANY, and uses "ANY response" for the DNS responses produced in that context.</t>
      </section>
      <section anchor="requirements-language">
        <name>Requirements Language</name>
        <t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
"<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they
appear in all capitals, as shown here.</t>
        <?line -18?>

</section>
    </section>
    <section anchor="motivation">
      <name>Motivation</name>
      <t>ANY queries raise various operational and security considerations in practical deployments. This section first outlines these issues and then identifies why reliance solely upon the authoritative-side minimization mechanism defined in <xref target="RFC8482"/> is insufficient to fully mitigate these risks.</t>
      <section anchor="operational-and-security-issues-associated-with-any-queries">
        <name>Operational and Security Issues Associated with ANY Queries</name>
        <t>ANY queries may cause a server to return multiple records beyond what the client actually requested, thereby increasing the risk of information disclosure. This naturally leads operators toward minimizing such responses.</t>
        <t>Responses to ANY queries are often large in size and can be abused in DNS-based amplification attacks. An attacker can spoof the source IP address and send ANY queries to resolvers, causing large responses to be reflected to a victim, thereby amplifying the attack (see <xref target="RFC5358"/>).</t>
        <t>Processing an ANY query requires the DNS server to aggregate multiple resource records to generate a response, and these responses are typically large, which can introduce additional operational burden.</t>
        <t>ANY responses are frequently large enough to cause IP datagram fragmentation. Fragmentation during transmission or handling can introduce additional security risks, including packet loss and blocking.</t>
        <t>Different DNS servers may adopt inconsistent methods for processing ANY queries or generating response content, resulting in unpredictable behavior. This unpredictability may lead to operational challenges and could potentially be exploited to create security risks.</t>
      </section>
      <section anchor="limitations-of-authoritative-side-minimization">
        <name>Limitations of Authoritative-Side Minimization</name>
        <t>Although <xref target="RFC8482"/> defines a mechanism for authoritative servers to minimize responses to ANY queries, recursive resolvers may generate ANY responses directly from cached RRsets (e.g., A, AAAA, TXT records) without retrieving minimized results from authoritative servers. As a result, the ANY responses returned by recursive resolvers to clients can still be large, potentially leading to information disclosure, amplification attacks, and other operational and security issues. Therefore, relying solely on authoritative-side minimization is insufficient to fully mitigate these risks. This document provides complementary guidance for recursive resolvers on minimizing responses to ANY queries in order to reduce the potential impact.</t>
      </section>
    </section>
    <section anchor="handling-of-any-queries-by-recursive-resolvers">
      <name>Handling of ANY Queries by Recursive Resolvers</name>
      <section anchor="overview">
        <name>Overview</name>
        <t>To mitigate the operational and security risks associated with ANY queries, this section first defines the core defensive principle for recursive resolvers: a resolver <bcp14>SHOULD</bcp14> rely on the authoritative server's minimized response as the basis for answering ANY queries and <bcp14>SHOULD</bcp14> avoid constructing an ANY response that exceeds the size of the authoritative response by synthesizing data from its local cache.</t>
        <t>In addition, recognizing that some authoritative servers have not yet deployed response minimization for ANY queries, a recursive resolver <bcp14>MAY</bcp14> implement supplementary mitigation measures in accordance with its local policy and operational requirements.</t>
      </section>
      <section anchor="core-defense-mechanism">
        <name>Core Defense Mechanism</name>
        <t>A recursive resolver can maintain a dedicated cache for ANY queries to avoid combining multiple cached RRsets into an excessively large ANY response, which helps reduce potential security risks. In this case, if the authoritative server has deployed an ANY-query minimization mechanism, the recursive resolver <bcp14>SHOULD</bcp14> return the minimized response from the authoritative server directly to the client, rather than relying on locally cached RRsets to synthesize a larger ANY response.</t>
        <t>In addition, since some authoritative servers may refuse or not support ANY queries, a resolver may consider applying negative caching for such responses.</t>
      </section>
      <section anchor="additional-mitigations">
        <name>Additional Mitigations</name>
        <t>RRset Minimization and Response Byte Limits:
A resolver <bcp14>MAY</bcp14> respond using a single RRset or a subset of available RRsets. However, certain RRsets (e.g., large TXT or RRSIG records) can have considerable size, and implementers <bcp14>SHOULD</bcp14> consider placing an upper bound on the total response size, such as limiting UDP responses to 512 bytes, to mitigate security risks.</t>
        <t>Rate Limiting for ANY queries:
A recursive resolver may apply a rate-limiting mechanism for QTYPE=ANY queries to reduce the risk associated with potential abuse. Since ANY queries may generate large response sizes, applying moderate rate limits can help mitigate potential risks. The specific rate-limiting policy is left to the implementer to determine based on local deployment considerations.</t>
      </section>
    </section>
    <section anchor="implementation-experience">
      <name>Implementation Experience</name>
      <t>NSD implements a subset-mode response to ANY queries.</t>
      <t>Unbound supports a "deny-any" mode, in which ANY queries are rejected.</t>
      <t>BIND9 implements a single RRset response to ANY queries.</t>
    </section>
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <t><xref target="RFC8482"/> defines response-minimization mechanisms for authoritative servers, but these mechanisms do not constrain how recursive resolvers may synthesize large ANY responses from their caches. Such synthesized responses can still be exploited for reflection or amplification attacks.</t>
      <t>This document provides complementary guidance for recursive resolvers to reduce the associated attack surface while preserving the availability of legitimate queries.</t>
    </section>
  </middle>
  <back>
    <references anchor="sec-combined-references">
      <name>References</name>
      <references anchor="sec-normative-references">
        <name>Normative References</name>
        <reference anchor="RFC2119">
          <front>
            <title>Key words for use in RFCs to Indicate Requirement Levels</title>
            <author fullname="S. Bradner" initials="S." surname="Bradner"/>
            <date month="March" year="1997"/>
            <abstract>
              <t>In many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="2119"/>
          <seriesInfo name="DOI" value="10.17487/RFC2119"/>
        </reference>
        <reference anchor="RFC8174">
          <front>
            <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
            <author fullname="B. Leiba" initials="B." surname="Leiba"/>
            <date month="May" year="2017"/>
            <abstract>
              <t>RFC 2119 specifies common key words that may be used in protocol specifications. This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the defined special meanings.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="8174"/>
          <seriesInfo name="DOI" value="10.17487/RFC8174"/>
        </reference>
      </references>
      <references anchor="sec-informative-references">
        <name>Informative References</name>
        <reference anchor="RFC5358">
          <front>
            <title>Preventing Use of Recursive Nameservers in Reflector Attacks</title>
            <author fullname="J. Damas" initials="J." surname="Damas"/>
            <author fullname="F. Neves" initials="F." surname="Neves"/>
            <date month="October" year="2008"/>
            <abstract>
              <t>This document describes ways to prevent the use of default configured recursive nameservers as reflectors in Denial of Service (DoS) attacks. It provides recommended configuration as measures to mitigate the attack. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="140"/>
          <seriesInfo name="RFC" value="5358"/>
          <seriesInfo name="DOI" value="10.17487/RFC5358"/>
        </reference>
        <reference anchor="RFC8482">
          <front>
            <title>Providing Minimal-Sized Responses to DNS Queries That Have QTYPE=ANY</title>
            <author fullname="J. Abley" initials="J." surname="Abley"/>
            <author fullname="O. Gudmundsson" initials="O." surname="Gudmundsson"/>
            <author fullname="M. Majkowski" initials="M." surname="Majkowski"/>
            <author fullname="E. Hunt" initials="E." surname="Hunt"/>
            <date month="January" year="2019"/>
            <abstract>
              <t>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, performance, or other reasons.</t>
              <t>The DNS specification does not include specific guidance for the behavior of DNS servers or clients in this situation. This document aims to provide such guidance.</t>
              <t>This document updates RFCs 1034 and 1035.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8482"/>
          <seriesInfo name="DOI" value="10.17487/RFC8482"/>
        </reference>
        <reference anchor="RFC8499">
          <front>
            <title>DNS Terminology</title>
            <author fullname="P. Hoffman" initials="P." surname="Hoffman"/>
            <author fullname="A. Sullivan" initials="A." surname="Sullivan"/>
            <author fullname="K. Fujiwara" initials="K." surname="Fujiwara"/>
            <date month="January" year="2019"/>
            <abstract>
              <t>The Domain Name System (DNS) is defined in literally dozens of different RFCs. The terminology used by implementers and developers of DNS protocols, and by operators of DNS systems, has sometimes changed in the decades since the DNS was first defined. This document gives current definitions for many of the terms used in the DNS in a single document.</t>
              <t>This document obsoletes RFC 7719 and updates RFC 2308.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8499"/>
          <seriesInfo name="DOI" value="10.17487/RFC8499"/>
        </reference>
      </references>
    </references>
  </back>
  <!-- ##markdown-source:
H4sIAAAAAAAAA61Zf5MTuRH9fz6FYqpykLJduxuogHO5u2UXwl7tD9hdigBF
peQZ2dbteDSRNGsMxXfJZ8kny+uW5pfXzh3kKApmNCNNq/v169fyaDRKnJd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