<?xml version="1.0" encoding="utf-8"?>
<?xml-model href="rfc7991bis.rnc"?>
<!-- <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?> -->
<rfc
  xmlns:xi="http://www.w3.org/2001/XInclude"
  category="exp"
  docName="draft-bortzmeyer-dnsop-poisonlicious-05"
  ipr="trust200902"
  obsoletes=""
  updates=""
  submissionType="IETF"
  xml:lang="en"
  version="3">

  <front>
    <title abbrev="Poisonlicious">Synchronizing caches of DNS resolvers</title>

    <seriesInfo name="Internet-Draft" value="draft-bortzmeyer-dnsop-poisonlicious-05"/>

    <author fullname="Stéphane Bortzmeyer" initials="S." surname="Bortzmeyer">

      <organization>Afnic</organization>
      <address>
        <postal>
          <street>7 avenue du 8 mai 1945</street>
          <city>Guyancourt</city>
          <code>78280</code>
          <country>FR</country>
        </postal>
        <email>bortzmeyer+ietf@nic.fr</email>
        <uri>https://www.afnic.fr/</uri>
      </address>
    </author>

    <author fullname="Willem Toorop" initials="W." surname="Toorop">

      <organization>NLnet Labs</organization>
      <address>
        <postal>
          <street>Science Park 400</street>
          <city>Amsterdam</city>
          <code>1098 XH</code>
          <country>NL</country>
        </postal>
        <email>willem@nlnetlabs.nl</email>
        <uri>https://nlnetlabs.nl/</uri>
      </address>
    </author>


    <author fullname="Babak Farrokhi" initials="B." surname="Farrokhi">

      <organization>Quad9</organization>
      <address>
        <postal>
          <street>Werdstrasse 2</street>
          <city>Zürich</city>
          <code>8004</code>
          <country>CH</country>
        </postal>
        <email>babak@farrokhi.net</email>
        <uri>https://quad9.net/</uri>
      </address>
    </author>


    <author fullname="Moin Rahman" initials="M." surname="Rahman">

      <organization>The FreeBSD Foundation</organization>
      <address>
        <postal>
          <street>3980 Broadway St</street>
          <city>Boulder</city>
          <code>CO 80304</code>
          <country>US</country>
        </postal>
        <email>bofh@freebsd.org</email>
        <uri>https://freebsdfoundation.org/</uri>
      </address>
    </author>

    <author initials="O." surname="Surý" fullname="Ondřej Surý">
      <organization showOnFrontPage="true">Internet Systems Consortium</organization>
      <address>
        <postal>
          <country>Czech Republic</country>
        </postal>
        <email>ondrej@isc.org</email>
      </address>
    </author>

    <author fullname="Otto Moerbeek" initials="O." surname="Moerbeek">
      <organization>PowerDNS</organization>
      <address>
        <postal>
          <country>NL</country>
        </postal>
        <email>otto.moerbeek@powerdns.com</email>
      </address>
    </author>

    <date year="2026" month="August" day="3"/>

    <area>General</area>
    <workgroup>Internet Engineering Task Force</workgroup>

    <keyword>DNS DNSSEC optimization caching</keyword>

    <abstract>
      <t>Networks of cooperating and mutually trusting DNS resolvers
      could benefit from cache sharing, where one resolver would
      distribute the result of a resolution to other resolvers. This
      document standardizes a protocol to do so.</t>
    </abstract>

  </front>

  <middle>

    <section>
      <name>Introduction</name>
      <t>When an organisation operates a big network of DNS resolvers
      <xref target="RFC1034"/> <xref target="RFC1035"/>, for
      instance for an important public resolver (<xref
      section="6" sectionFormat="of" target="RFC9499"/>), it may be a performance
      improvement to distribute the result of the resolution process
      between the resolvers. The same applies to resolvers operated by
      distinct organisations which have agreed to cooperate. This
      document standardizes how to do
      so, using unicast messages to a
      set of pre-configured peers.
      </t>

      <section>
        <name>Requirements Language</name>
        <t>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 <xref target="RFC2119"/>
          <xref target="RFC8174"/> when, and only when, they appear in
          all capitals, as shown here.</t>
      </section>

      <section>
        <name>Terminology</name>
        <dl newline="true">
        <dt>Network of resolvers</dt>
        <dd>A set of mutually trusting resolvers working together under a
        common policy, often but not necessarily under the same administration</dd>
        <dt>Peer (or peer resolver)</dt>
        <dd>One of the other resolvers in the network</dd>
        <dt>Originating resolver</dt>
        <dd>A resolver sending data to its peers in the network</dd>
        <dt>Receiving resolver (or receiving peer)</dt>
        <dd>A resolver receiving data from one of its peers in the network</dd>
        <dt>Resolver</dt>
        <dd>As used in <xref section="6" sectionFormat="of" target="RFC9499"/></dd>
      </dl>
      </section>

    </section>

    <section>
      <name>The protocol</name>
      <t>When completing a successful DNS resolution, the resolver
      transmits a DNS message (with the Q/R bit set, since it is a
      response) to the pre-configured peers. No acknowledgment is
      sent or expected. To save work, the resolver <bcp14>MAY</bcp14> send the data only if the TTL
      is higher than some predefined value.</t>
      <t>TSIG <xref target="RFC8945"/> is mandatory to implement but optional to
      use, following <xref section="7" sectionFormat="of" target="RFC3365"/>.
      Implementations <bcp14>MUST</bcp14> support it, so that peers always have
      one authentication mechanism in common. Whether a given network of
      resolvers enables it is outside of the scope of this document.</t>
      <t>The resolver <bcp14>MUST</bcp14> send
      only data that it is sure of (for instance by DNSSEC validation
      or because it came with the AA bit from the queried
      server). All the resolvers of the network <bcp14>MUST</bcp14> agree on
      the same policy for this assessment. When they are not under the same
      administration, this policy <bcp14>MUST</bcp14> be agreed explicitly
      before deployment, since it cannot be inferred from a shared
      administrative practice.</t>
      <t>Negative answers (<xref target="RFC9499"/>, section 3)
      <bcp14>MUST NOT</bcp14> be
      transmitted to peers.</t>
      <t>A message of this protocol is a response signed like a query. Since
      there is no request MAC (<xref section="4.3.1" sectionFormat="of"
      target="RFC8945"/>), the MAC <bcp14>MUST</bcp14> be computed over the
      digest components listed for a request in <xref section="5.1"
      sectionFormat="of" target="RFC8945"/>. This distinguishes it from an
      ordinary DNS response. The TSIG key <bcp14>SHOULD</bcp14> nevertheless be
      specific to this protocol. Peers that do not use TSIG need another
      discriminator, for instance a dedicated port.</t>
      <t>This message <bcp14>MUST</bcp14> be a new message (not the message received by the resolver from
      the authoritative name servers) with
      data composed from data already obtained and validated by the
      originating resolver. It
      <bcp14>MUST</bcp14> contain an Answer section and <bcp14>MAY</bcp14> contain other sections.
      (So, the Question section is not mandatory.)</t>
      <t>The EDNS section <bcp14>MUST</bcp14> be a new one, created to fit the needs
      of successful transmission to the peer.</t>
      <t>Each peer then <bcp14>MAY</bcp14> store the data in
      its cache. The peer is not supposed to do DNSSEC validation
      (there is not always all the necessary data in the
      message). After all, the goal is to save work for the peers, so  <xref
      section="5.4.1" sectionFormat="of" target="RFC2181"/> does not
      apply here. (Remember all peers
      trust each other, and have a consistent policy.
      The data is as trustworthy as if you validated it yourself.) A resolver
      which cannot rely on its peers applying the agreed policy
      <bcp14>MUST NOT</bcp14> accept their data. The
      receiver <bcp14>MAY</bcp14> cache only what is in the Answer section.</t>
    </section>

    <section anchor="IANA">
      <name>IANA Considerations</name>
      <t>None. [RFC-Editor: you may delete this section]</t>
    </section>

    <section anchor="Security">
      <name>Security Considerations</name>
      <t>The integrity and authenticity of the cached data is of
      course critical. DNSSEC would help but it is not yet universally
      deployed and, moreover, the peer resolvers should not have to
      redo the validation. So, trust between the peer resolvers is
      expected because it is the only way for the receiver to be sure
      of the data. Having all of the peers under the same administration is the
      simplest way to obtain this trust, but it is not the only one.</t>
      <t>The channel between peers also needs protection, preferably with
      cryptography. ACL and other network techniques are of course useful.</t>
      <t>Sharing one TSIG key across the whole network lets any peer impersonate
      any other (<xref section="10" sectionFormat="of" target="RFC8945"/>). Using
      a distinct key per pair of peers is more important when the peers are not
      under the same administration.</t>
    </section>

    <section anchor="Privacy">
      <name>Privacy Considerations</name>
      <t>The records transmitted are public, but the messages contain the names
      that the resolvers have resolved, and therefore reveal to an eavesdropper
      what their clients looked up <xref target="RFC9076"/>. Removing the
      question section does not hide
      this, since the answer section contains the owner name. Using an encrypted
      transport, for instance DoT <xref target="RFC7858"/> or DoQ <xref
      target="RFC9250"/>, or otherwise protecting the network path between
      peers, defeats this leakage and is <bcp14>RECOMMENDED</bcp14> when the
      messages travel over the public Internet.</t>
      <t>If the originating resolver sends the original question
      section in its messages to receiving peers, it can have
      privacy consequences <xref
      target="RFC9076"/>, for instance in the case of negative answers. When all
      the peers are under the same administration, these consequences are
      limited, and the originator <bcp14>SHOULD</bcp14> remove this section or
      replace it with dummy data. When the peers are under distinct
      administrations, the question section would disclose the queries of one
      party's clients to another, and the originator <bcp14>MUST</bcp14> remove
      it or replace it with dummy data.</t>
    </section>
    
    <section anchor="Operation">
      <name>Operational Considerations</name>
      <t>It is reminded that all resolvers in the network need to trust
      each other. This specification is not meant to be deployed between
      unrelated resolvers.</t>
      <t>The network of peer resolvers has to be configured
      out-of-band beforehand. The way to do it is out-of-scope for this specification.</t>
    </section>

    <section anchor="related-future">
      <name>Related and future work</name>
      <section>
        <name>Related work</name>
        <t><xref target="I-D.hl-dnsop-cache-filling"/> describes a
        mechanism to fill DNS caches with data. The format is, like in
        this document, standard DNS as seen on the wire.</t>
      </section>
      <section>
      <name>Future work</name>
      <section>
        <name>Actual measurement</name>
        <t>Measuring the efficiency of caching
      optimizations is hard because the performance depends a lot on
      the actual queries sent and their timeline. It would be interesting to test on real-world data to
        measure the improvement brought by this technology.</t>
      </section>
      <section>
        <name>Negative answers</name>
        <t>In the future, we may allow negative answers to be
        sent, which would permit the receivers to use <xref
        target="RFC8020"/> and/or <xref target="RFC8198"/> to
        synthesize negative answers.</t>
        <t>Be careful of
        the risk of overloading receiving peers for instance when there
        is a dictionary attack.</t>
      </section>
      <section>
        <name>ECS</name>
        <t>Today, we don't transmit the EDNS record since EDNS is not
        end-to-end. But ECS
      <xref target="RFC7871"/> may be an important information for the
      participating resolvers.</t>
      </section>
      <section>
        <name>Authentication</name>
        <t>Standardizing how peers select an alternative authentication
        mechanism, such as SIG(0) <xref target="RFC2931"/> or DoT <xref
        target="RFC7858"/>, is future work.</t>
      </section>
      <section>
        <name>Dispatching of messages</name>
        <t>Today, messages following this specification are sent to
        the proper handler based on the TSIG key used. It could be an
        interesting alternative to use a separate transport port instead.</t>
      </section>
      <section>
        <name>Transport of messages</name>
         <t>Messages could be transmitted in long-lived TCP sessions, too.</t>
         <t>If there are 1,000 servers, sending 1,000 messages, or having a full
         mesh of 1,000 TCP connections may be too much. It may be interesting to replace the unicast messages by
         multicast <xref target="RFC5110"/> (the issues of multicast on the public Internet do
         not apply here since we envision work under only one
         administration. A network spanning several administrations would have
         to face them).</t>
         <t>Other protocols may be considered such as MQTT
         <xref target="MQTT"/> which is well suited for
         publish-by-one/consume-by-many, raw protocol buffers <xref
         target="GPB"/> or dnstap <xref target="dnstap"/> over
         them.</t>
         <t>Also, a different organisation of the network of
         resolvers could be done in a hub-and-spoke way, in the future.</t>
      </section>
      <section>
        <name>Packing of messages</name>
        <t>It could be interesting to optimize by packing the data in a C-DNS <xref
      target="RFC8618"/> flow, sent with TCP (with TLS) or
      QUIC. (Of course, other formats/protocols are possible.)</t>
      </section>
      <section>
        <name>Different responses</name>
        <t>When the authoritative servers send different replies
        depending on the client, the various peers may send different
        (and under-optimized) responses to a receiving peer.</t>
      </section>
    </section>
    </section>
  </middle>

  <back>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>

        <xi:include
            href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.1034.xml"/>
        <xi:include
            href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.1035.xml"/>
        <xi:include
            href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
        <xi:include
            href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8945.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9499.xml"/>
      </references>

      <references>
        <name>Informative References</name>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2181.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2931.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.3365.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5110.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7858.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7871.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8020.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8198.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8618.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9076.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9250.xml"/>
        <xi:include
            href="https://datatracker.ietf.org/doc/bibxml3/draft-hl-dnsop-cache-filling.xml"/>
        <reference anchor="MQTT" target="https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.docx">
          <front>
            <title>MQTT Version 5.0</title>
            <author>
              <organization>OASIS</organization>
            </author>
            <date year="2019"/>
          </front>
        </reference>
        <!-- https://mqtt.org/mqtt-specification/ -->
        <reference anchor="GPB"
                   target="https://protobuf.dev/">
          <front>
            <title>Protocol Buffers</title>
            <author>
              <organization>Google Developers</organization>
            </author>
          </front>
        </reference>
        <reference anchor="dnstap"
                   target="https://dnstap.info/">
          <front>
            <title>dnstap</title>
            <author fullname="Robert Edmonds"/>
            <date year="2014"/>
          </front>
        </reference>
      </references>
    </references>

        <section anchor="Acknowledgements" numbered="false">
      <name>Acknowledgements</name>
      <t>Original idea at the DNS hackathon (RIPE-NCC / Netnod / DNS-OARC) in march 2025 at the
      Netnod office in Stockholm.</t>
    </section>

 </back>
</rfc>
