<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE rfc [
<!ENTITY RFC2119 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC3688 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3688.xml">
<!ENTITY RFC5731 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5731.xml">
<!ENTITY RFC5732 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5732.xml">
<!ENTITY RFC5910 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5910.xml">
<!ENTITY RFC6895 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6895.xml">
<!ENTITY RFC6927 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6927.xml">
<!ENTITY RFC7451 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7451.xml">
<!ENTITY RFC8499 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8499.xml">
<!ENTITY RFC8590 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8590.xml">
<!ENTITY RFC9364 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9364.xml">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<?rfc strict="yes" ?>
<?rfc toc="yes"?>
<?rfc tocdepth="4"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes" ?>
<?rfc compact="yes" ?>
<?rfc subcompact="no" ?>
<?rfc comments="yes" ?>
<?rfc inline="yes" ?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" category="std" docName="draft-ietf-regext-epp-ttl-04" ipr="trust200902" submissionType="IETF" consensus="true">
  <front>
    <title abbrev="TTL mapping for EPP">Extensible Provisioning Protocol (EPP) mapping for DNS Time-To-Live (TTL) values</title>
    <author fullname="Gavin Brown" initials="G" surname="Brown">
      <organization>ICANN</organization>
      <address>
        <postal>
          <street>12025 Waterfront Drive, Suite 300</street>
          <city>Los Angeles</city>
          <region>CA</region>
          <code>90292</code>
          <country>US</country>
        </postal>
        <email>gavin.brown@icann.org</email>
        <uri>https://www.icann.org/</uri>
      </address>
    </author>
    <date year="" month="" day=""/>
    <area>Applications</area>
    <workgroup>Registration Protocols Extensions (regext)</workgroup>
    <abstract>
      <t>
This document describes an extension to the Extensible Provisioning Protocol (EPP) that allows EPP clients to manage the Time-To-Live (TTL) value for domain name delegation records.
</t>
    </abstract>
    <note title="About this draft" removeInRFC="true">
      <t>
The source for this draft, and an issue tracker, may can be found at <eref target="https://github.com/gbxyz/epp-ttl-extension"/>.
</t>
    </note>
  </front>
  <middle>
    <section title="Introduction">
      <t>
The principal output of any domain name provisioning system is a DNS zone file, which contains the delegation record(s) for names registered within a zone (such as a top-level domain).
These records typically include one or more <spanx style="verb">NS</spanx> records, but may also include <spanx style="verb">DS</spanx> records for domains secured with DNSSEC (<xref target="RFC9364"/>), and <spanx style="verb">DNAME</spanx> records for IDN variants (<xref target="RFC6927"/>).
Where glue (see <xref section="7" sectionFormat="of" target="RFC8499"/>) is required, <spanx style="verb">A</spanx> and/or <spanx style="verb">AAAA</spanx> records may also be published for nameservers.
</t>
      <t>
Typically, the Time-To-Live value (TTL, see <xref section="5" sectionFormat="of" target="RFC8499"/>) of these records is determined by the registry operator.
However, in some circumstances it may be desirable to allow the sponsoring client of a domain name to change the TTL values used for that domain's delegation: for example, to reduce the amount of time required to complete a change of DNS servers, DNSSEC deployment or key rollover, or to allow for fast rollback of such changes.
</t>
      <t>
This document describes an EPP extension to the domain name and host object mappings (described in <xref target="RFC5731"/> and <xref target="RFC5732"/>, respectively) which allows the sponsor of a domain name or host object to change the TTL values of the resource record(s) associated with that object.
It also describes how EPP servers should handle TTLs specified by EPP clients, and how both parties co-ordinate to manage TTL values in response to changes in operational or security requirements.
</t>
      <section title="Conventions used in this document">
        <t>
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in <xref target="RFC2119"/>.
</t>
        <t>
In examples, "C:" represents lines sent by a protocol client and "S:" represents lines returned by a protocol server.
Indentation and white space in examples are provided only to illustrate element relationships and are not required features of this protocol.
</t>
        <t>
A protocol client that is authorized to manage an existing object is described as a "sponsoring" client throughout this document.
</t>
        <t>
XML is case sensitive.
Unless stated otherwise, XML specifications and examples provided in this document <bcp14>MUST</bcp14> be interpreted in the character case presented in order to develop a conforming implementation.
</t>
        <t>
EPP uses XML namespaces to provide an extensible object management framework and to identify schemas required for XML instance parsing and validation.
These namespaces and schema definitions are used to identify both the base protocol schema and the schemas for managed objects.
</t>
        <t>
The XML namespace prefixes used in examples (such as the string <spanx style="verb">ttl</spanx> in <spanx style="verb">ttl:create</spanx>) are solely for illustrative purposes.
A conforming implementation <bcp14>MUST NOT</bcp14> require the use of these or any other specific namespace prefixes.
</t>
      </section>
      <section title="Extension elements" anchor="extension-elements">
        <t>
This extension adds additional elements to the EPP domain and host mappings.
</t>
        <t>
The <spanx style="verb">&lt;ttl:ttl&gt;</spanx> element is used to define TTL values for the DNS resource records associated with domain and host objects.
</t>
        <t>
The <spanx style="verb">&lt;ttl:ttl&gt;</spanx> element may have the following attributes, depending on whether it appears in a command or response frame:
</t>
        <ol>
          <li>
"<spanx style="verb">for</spanx>", which is <bcp14>REQUIRED</bcp14> in both commands and responses, and which specifies the DNS record type to which the TTL value pertains. This attribute <bcp14>MUST</bcp14> have one of the following values: "<spanx style="verb">NS</spanx>", "<spanx style="verb">DS</spanx>", "<spanx style="verb">DNAME</spanx>", "<spanx style="verb">A</spanx>", "<spanx style="verb">AAAA</spanx>" or "<spanx style="verb">custom</spanx>";
</li>
          <li>
If the value of the "<spanx style="verb">for</spanx>" attribute is "<spanx style="verb">custom</spanx>", then the <spanx style="verb">&lt;ttl:ttl&gt;</spanx> element <bcp14>MUST</bcp14> also have a "<spanx style="verb">custom</spanx>" attribute containing a DNS record type conforming with the regular expression in <xref sectionFormat="of" section="1.3" target="RFC6895"/>.
Additionally, the record type <bcp14>MUST</bcp14> be registered with IANA.
</li>
          <li>
"<spanx style="verb">min</spanx>", which <bcp14>MUST NOT</bcp14> be present in commands frames but <bcp14>MUST</bcp14> be present in response frames, and which is used by the server to indicate the lowest value that may be set;
</li>
          <li>
"<spanx style="verb">default</spanx>", which <bcp14>MUST NOT</bcp14> be present in commands frames but <bcp14>MUST</bcp14> be present in response frames, and which is used by the server to indicate the default value;
</li>
          <li>
"<spanx style="verb">max</spanx>", which <bcp14>MUST NOT</bcp14> be present in commands frames but <bcp14>MUST</bcp14> be present in response frames, and which is used by the server to indicate the highest value that may be set;
</li>
        </ol>
        <section title="Element content" anchor="element-content">
          <t>
The XML schema found in <xref target="formal-syntax"/> of this document restricts the content of <spanx style="verb">&lt;ttl:ttl&gt;</spanx> elements to be either:
</t>
          <ol>
            <li>
a non-negative integer, indicating the value of the TTL in seconds, or
</li>
            <li>
empty, in which case the server's default TTL for the given record type is to be applied.
</li>
          </ol>
        </section>
        <section title="Supported DNS record types" anchor="supported-dns-record-types">
          <t>
To facilitate forward compatibility with future changes to the DNS protocol, this document does not enumerate or restrict the DNS record types that can be included in the "<spanx style="verb">for</spanx>" and "<spanx style="verb">custom</spanx>" attributes of <spanx style="verb">&lt;ttl:ttl&gt;</spanx> elements.
</t>
          <t>
The regular expression which is used to validate the values of the "<spanx style="verb">custom</spanx>" attribute is based on the expression found in <xref sectionFormat="of" section="1.3" target="RFC6895"/>, and is intended to match any existing and future RRTYPE mnemonic registered with the IANA: this eliminates the need to update this document in the event that a new DNS record that exists above a zone cut is specified.
</t>
          <t>
Nevertheless, EPP servers which implement this extension <bcp14>MUST</bcp14> restrict the DNS record types that are accepted in <spanx style="verb">&lt;create&gt;</spanx> and <spanx style="verb">&lt;update&gt;</spanx> commands, and included in <spanx style="verb">&lt;info&gt;</spanx> responses, allowing only those types that are actually published in the DNS for domain and host objects.
</t>
          <t>
A server which receives a <spanx style="verb">&lt;create&gt;</spanx> or <spanx style="verb">&lt;update&gt;</spanx> command which includes an invalid DNS record type <bcp14>MUST</bcp14> respond with a 2004 "Parameter value range" error.
</t>
          <t>
As an illustrative example, a server <bcp14>MAY</bcp14> allow clients to specify TTL values for the following record types for domain objects:
</t>
          <ol>
            <li><spanx style="verb">NS</spanx>;
</li>
            <li><spanx style="verb">DS</spanx> (if the server also implements <xref target="RFC5910"/>);
</li>
            <li><spanx style="verb">DNAME</spanx> (if the registry implements IDN variants using <spanx style="verb">DNAME</spanx> records).
</li>
          </ol>
          <section title="Glue records">
            <t>
Servers which implements host objects (<xref target="RFC5732"/>) <bcp14>MAY</bcp14> allow clients to specify TTL values for <spanx style="verb">A</spanx> and <spanx style="verb">AAAA</spanx> records for host objects.
These servers <bcp14>MUST</bcp14> reject commands which attempt to set TTL values for these record types for domain objects.
</t>
            <t>
EPP servers which uses the "host attribute" model (described in <xref sectionFormat="of" section="1.1" target="RFC5731"/>) <bcp14>MAY</bcp14> allow clients to specify TTL values for <spanx style="verb">A</spanx> and <spanx style="verb">AAAA</spanx> records for domain objects using a 2004 "Parameter value range" error.
</t>
          </section>
        </section>
        <section title="Examples">
          <section title="Explicit TTL value">
            <sourcecode>&lt;ttl:ttl for="NS"&gt;3600&lt;ttl:ttl&gt;</sourcecode>
          </section>
          <section title="Empty value indicating default TTL">
            <sourcecode>&lt;ttl:ttl for="NS"/&gt;</sourcecode>
          </section>
          <section title="Custom record type">
            <sourcecode>&lt;ttl:ttl
  for="custom"
  custom="DELEG"&gt;3600&lt;ttl:ttl&gt;</sourcecode>
          </section>
        </section>
      </section>
    </section>
    <section title="EPP command mapping">
      <section title="EPP query commands">
        <section title="EPP &lt;info&gt; command">
          <t>
This extension defines an additional element for EPP <spanx style="verb">&lt;info&gt;</spanx> responses for domain and host objects.
</t>
          <t>
When a server receives a domain or host <spanx style="verb">&lt;info&gt;</spanx> command from a client which included the extension namespace in the <spanx style="verb">&lt;svcExtension&gt;</spanx> element of the <spanx style="verb">&lt;login&gt;</spanx> command, the response <bcp14>MUST</bcp14> contain an <spanx style="verb">&lt;extension&gt;</spanx> element, which <bcp14>MUST</bcp14> contain a <spanx style="verb">&lt;ttl:infData&gt;</spanx> element.
This element <bcp14>MUST</bcp14> contain one or more <spanx style="verb">&lt;ttl:ttl&gt;</spanx> records as described in <xref target="extension-elements"/>.
</t>
          <t>
Example domain <spanx style="verb">&lt;info&gt;</spanx> response:
</t>
          <sourcecode>S:&lt;?xml version="1.0" encoding="utf-8" standalone="no"?&gt;
S:&lt;epp xmlns="urn:ietf:params:xml:ns:epp-1.0"&gt;
S:  &lt;response&gt;
S:    &lt;result code="1000"&gt;
S:      &lt;msg&gt;Command completed successfully&lt;/msg&gt;
S:    &lt;/result&gt;
S:    &lt;resData&gt;
S:      &lt;domain:infData
S:        xmlns:domain="urn:ietf:params:xml:ns:domain-1.0"&gt;
S:        &lt;domain:name&gt;example.com&lt;/domain:name&gt;
S:        &lt;domain:roid&gt;EXAMPLE1-REP&lt;/domain:roid&gt;
S:        &lt;domain:status s="ok"/&gt;
S:        &lt;domain:ns&gt;
S:          &lt;domain:hostObj&gt;ns1.example.com&lt;/domain:hostObj&gt;
S:          &lt;domain:hostObj&gt;ns1.example.net&lt;/domain:hostObj&gt;
S:        &lt;/domain:ns&gt;
S:        &lt;domain:clID&gt;ClientX&lt;/domain:clID&gt;
S:        &lt;domain:crID&gt;ClientX&lt;/domain:crID&gt;
S:        &lt;domain:crDate&gt;2023-11-08T10:14:55.0Z&lt;/domain:crDate&gt;
S:        &lt;domain:exDate&gt;2024-11-08T10:14:55.0Z&lt;/domain:exDate&gt;
S:      &lt;/domain:infData&gt;
S:    &lt;/resData&gt;
S:    &lt;extension&gt;
S:      &lt;ttl:infData
S:        xmlns:ttl="urn:ietf:params:xml:ns:epp:ttl-1.0"&gt;
S:        &lt;ttl:ttl for="NS"
S:          min="3600"
S:          default="86400"
S:          max="172800"&gt;172800&lt;/ttl:ttl&gt;
S:        &lt;ttl:ttl for="DS"
S:          min="60"
S:          default="86400"
S:          max="172800"&gt;300&lt;/ttl:ttl&gt;
S:      &lt;/ttl:infData&gt;
S:      &lt;secDNS:infData
S:        xmlns:secDNS="urn:ietf:params:xml:ns:secDNS-1.1"&gt;
S:        &lt;secDNS:dsData&gt;
S:          &lt;secDNS:keyTag&gt;12345&lt;/secDNS:keyTag&gt;
S:          &lt;secDNS:alg&gt;13&lt;/secDNS:alg&gt;
S:          &lt;secDNS:digestType&gt;2&lt;/secDNS:digestType&gt;
S:          &lt;secDNS:digest&gt;49FD46E6C4B45C55D4AC&lt;/secDNS:digest&gt;
S:        &lt;/secDNS:dsData&gt;
S:      &lt;/secDNS:infData&gt;
S:    &lt;/extension&gt;
S:    &lt;trID&gt;
S:      &lt;clTRID&gt;ABC-12345&lt;/clTRID&gt;
S:      &lt;svTRID&gt;54322-XYZ&lt;/svTRID&gt;
S:    &lt;/trID&gt;
S:  &lt;/response&gt;
S:&lt;/epp&gt;
</sourcecode>
          <t>
Example host <spanx style="verb">&lt;info&gt;</spanx> response:
</t>
          <sourcecode>S:&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;
S:&lt;epp xmlns="urn:ietf:params:xml:ns:epp-1.0"&gt;
S:  &lt;response&gt;
S:    &lt;result code="1000"&gt;
S:      &lt;msg&gt;Command completed successfully&lt;/msg&gt;
S:    &lt;/result&gt;
S:    &lt;resData&gt;
S:      &lt;host:infData
S:        xmlns:host="urn:ietf:params:xml:ns:host-1.0"&gt;
S:        &lt;host:name&gt;ns1.example.com&lt;/host:name&gt;
S:        &lt;host:roid&gt;NS1_EXAMPLE1-REP&lt;/host:roid&gt;
S:        &lt;host:status s="ok"/&gt;
S:        &lt;host:addr ip="v4"&gt;192.0.2.2&lt;/host:addr&gt;
S:        &lt;host:addr ip="v6"&gt;1080::8:800:200C:417A&lt;/host:addr&gt;
S:        &lt;host:clID&gt;ClientX&lt;/host:clID&gt;
S:        &lt;host:crID&gt;ClientX&lt;/host:crID&gt;
S:        &lt;host:crDate&gt;2023-11-08T10:14:55.0Z&lt;/host:crDate&gt;
S:      &lt;/host:infData&gt;
S:    &lt;/resData&gt;
S:    &lt;extension&gt;
S:      &lt;ttl:infData
S:        xmlns:ttl="urn:ietf:params:xml:ns:epp:ttl-1.0"&gt;
S:        &lt;ttl:ttl for="A"
S:          min="3600"
S:          default="86400"
S:          max="172800"/&gt;
S:        &lt;ttl:ttl for="AAAA"
S:          min="3600"
S:          default="86400"
S:          max="172800"&gt;86400&lt;/ttl:ttl&gt;
S:      &lt;/ttl:infData&gt;
S:    &lt;/extension&gt;
S:    &lt;trID&gt;
S:      &lt;clTRID&gt;ABC-12345&lt;/clTRID&gt;
S:      &lt;svTRID&gt;54322-XYZ&lt;/svTRID&gt;
S:    &lt;/trID&gt;
S:  &lt;/response&gt;
S:&lt;/epp&gt;
</sourcecode>
        </section>
      </section>
      <section title="EPP transform commands">
        <section title="EPP &lt;create&gt; command">
          <t>
This extension defines an additional element for EPP <spanx style="verb">&lt;create&gt;</spanx> commands for domain and host objects.
</t>
          <t>
The <spanx style="verb">&lt;command&gt;</spanx> element of the <spanx style="verb">&lt;create&gt;</spanx> command frame <bcp14>MAY</bcp14> contain an <spanx style="verb">&lt;extension&gt;</spanx> element which <bcp14>MAY</bcp14> contain a <spanx style="verb">&lt;ttl:create&gt;</spanx> element.
This element <bcp14>MUST</bcp14> contain one or more <spanx style="verb">&lt;ttl:ttl&gt;</spanx> records as described in <xref target="extension-elements"/>.
</t>
          <t>
Example domain <spanx style="verb">&lt;create&gt;</spanx> command:
</t>
          <sourcecode>C:&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;
C:&lt;epp xmlns="urn:ietf:params:xml:ns:epp-1.0"&gt;
C:  &lt;command&gt;
C:    &lt;create&gt;
C:      &lt;domain:create
C:        xmlns:domain="urn:ietf:params:xml:ns:domain-1.0"&gt;
C:        &lt;domain:name&gt;example.com&lt;/domain:name&gt;
C:        &lt;domain:period unit="y"&gt;1&lt;/domain:period&gt;
C:        &lt;domain:ns&gt;
C:          &lt;domain:hostObj&gt;ns1.example.com&lt;/domain:hostObj&gt;
C:          &lt;domain:hostObj&gt;ns1.example.net&lt;/domain:hostObj&gt;
C:        &lt;/domain:ns&gt;
C:        &lt;domain:authInfo&gt;
C:          &lt;domain:pw/&gt;
C:        &lt;/domain:authInfo&gt;
C:      &lt;/domain:create&gt;
C:    &lt;/create&gt;
C:    &lt;extension&gt;
C:      &lt;ttl:create
C:        xmlns:ttl="urn:ietf:params:xml:ns:epp:ttl-1.0"&gt;
C:        &lt;ttl:ttl for="NS"&gt;172800&lt;/ttl:ttl&gt;
C:        &lt;ttl:ttl for="DS"&gt;300&lt;/ttl:ttl&gt;
C:      &lt;/ttl:create&gt;
C:      &lt;secDNS:create
C:        xmlns:secDNS="urn:ietf:params:xml:ns:secDNS-1.1"&gt;
C:        &lt;secDNS:dsData&gt;
C:          &lt;secDNS:keyTag&gt;12345&lt;/secDNS:keyTag&gt;
C:          &lt;secDNS:alg&gt;13&lt;/secDNS:alg&gt;
C:          &lt;secDNS:digestType&gt;2&lt;/secDNS:digestType&gt;
C:          &lt;secDNS:digest&gt;49FD46E6C4B45C55D4AC&lt;/secDNS:digest&gt;
C:        &lt;/secDNS:dsData&gt;
C:      &lt;/secDNS:create&gt;
C:    &lt;/extension&gt;
C:    &lt;clTRID&gt;ABC-12345&lt;/clTRID&gt;
C:  &lt;/command&gt;
C:&lt;/epp&gt;
</sourcecode>
          <t>
Example host <spanx style="verb">&lt;create&gt;</spanx> command:
</t>
          <sourcecode>C:&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;
C:&lt;epp xmlns="urn:ietf:params:xml:ns:epp-1.0"&gt;
C:  &lt;command&gt;
C:    &lt;create&gt;
C:      &lt;host:create
C:        xmlns:host="urn:ietf:params:xml:ns:host-1.0"&gt;
C:        &lt;host:name&gt;ns1.example.com&lt;/host:name&gt;
C:        &lt;host:addr ip="v4"&gt;192.0.2.2&lt;/host:addr&gt;
C:        &lt;host:addr ip="v6"&gt;1080::8:800:200C:417A&lt;/host:addr&gt;
C:      &lt;/host:create&gt;
C:    &lt;/create&gt;
C:    &lt;extension&gt;
C:      &lt;ttl:create
C:        xmlns:ttl="urn:ietf:params:xml:ns:epp:ttl-1.0"&gt;
C:        &lt;ttl:ttl for="A"/&gt;
C:        &lt;ttl:ttl for="AAAA"&gt;86400&lt;/ttl:ttl&gt;
C:      &lt;/ttl:create&gt;
C:    &lt;/extension&gt;
C:    &lt;clTRID&gt;ABC-12345&lt;/clTRID&gt;
C:  &lt;/command&gt;
C:&lt;/epp&gt;
</sourcecode>
          <t>
If an EPP server receives a <spanx style="verb">&lt;create&gt;</spanx> command containing a TTL value that is outside the server's permitted range, it <bcp14>MUST</bcp14> reject the command with a <spanx style="verb">2306</spanx> "Parameter value policy error" response.
</t>
        </section>
        <section title="EPP &lt;update&gt; command">
          <t>
This extension defines an additional element for EPP <spanx style="verb">&lt;update&gt;</spanx> commands for domain and host objects.
</t>
          <t>
The <spanx style="verb">&lt;command&gt;</spanx> element of the <spanx style="verb">&lt;update&gt;</spanx> command frame <bcp14>MAY</bcp14> contain an <spanx style="verb">&lt;extension&gt;</spanx> element which <bcp14>MAY</bcp14> contain a <spanx style="verb">&lt;ttl:update&gt;</spanx> element.
This element <bcp14>MUST</bcp14> contain one or more <spanx style="verb">&lt;ttl:ttl&gt;</spanx> records as described in <xref target="extension-elements"/>.
</t>
          <t>
Example domain <spanx style="verb">&lt;update&gt;</spanx> command:
</t>
          <sourcecode>C:&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;
C:&lt;epp xmlns="urn:ietf:params:xml:ns:epp-1.0"&gt;
C:  &lt;command&gt;
C:    &lt;update&gt;
C:      &lt;domain:update
C:        xmlns:domain="urn:ietf:params:xml:ns:domain-1.0"&gt;
C:        &lt;domain:name&gt;example.com&lt;/domain:name&gt;
C:      &lt;/domain:update&gt;
C:    &lt;/update&gt;
C:    &lt;extension&gt;
C:      &lt;ttl:update
C:        xmlns:ttl="urn:ietf:params:xml:ns:epp:ttl-1.0"&gt;
C:        &lt;ttl:ttl for="NS"/&gt;
C:      &lt;/ttl:update&gt;
C:    &lt;/extension&gt;
C:    &lt;clTRID&gt;ABC-12345&lt;/clTRID&gt;
C:  &lt;/command&gt;
C:&lt;/epp&gt;
</sourcecode>
          <t>
Example host <spanx style="verb">&lt;update&gt;</spanx> command:
</t>
          <sourcecode>C:&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;
C:&lt;epp xmlns="urn:ietf:params:xml:ns:epp-1.0"&gt;
C:  &lt;command&gt;
C:    &lt;update&gt;
C:      &lt;host:update
C:        xmlns:host="urn:ietf:params:xml:ns:host-1.0"&gt;
C:        &lt;host:name&gt;ns1.example.com&lt;/host:name&gt;
C:      &lt;/host:update&gt;
C:    &lt;/update&gt;
C:    &lt;extension&gt;
C:      &lt;ttl:update
C:        xmlns:ttl="urn:ietf:params:xml:ns:epp:ttl-1.0"&gt;
C:        &lt;ttl:ttl for="A"&gt;86400&lt;/ttl:ttl&gt;
C:        &lt;ttl:ttl for="AAAA"&gt;3600&lt;/ttl:ttl&gt;
C:      &lt;/ttl:update&gt;
C:    &lt;/extension&gt;
C:    &lt;clTRID&gt;ABC-12345&lt;/clTRID&gt;
C:  &lt;/command&gt;
C:&lt;/epp&gt;
</sourcecode>
          <t>
If an EPP server receives an <spanx style="verb">&lt;update&gt;</spanx> command containing a TTL value that is outside the server's permitted range, it <bcp14>MUST</bcp14> reject the command with a <spanx style="verb">2306</spanx> "Parameter value policy error" response.
</t>
        </section>
      </section>
    </section>
    <section title="Server processing of TTL values">
      <section title="Permitted record types">
        <t>
Servers <bcp14>MAY</bcp14> restrict the supported DNS record types in accordance with their own operational needs.
For example, a server <bcp14>MAY</bcp14> allow clients to specify TTL values for <spanx style="verb">DS</spanx> records only.
</t>
        <t>
A server which receives a <spanx style="verb">&lt;create&gt;</spanx> or <spanx style="verb">&lt;update&gt;</spanx> command which includes a restricted record type <bcp14>MUST</bcp14> respond with a 2306 "Parameter value policy" error.
</t>
      </section>
      <section title="Use of TTL values in delegation records" anchor="using_ttl_values">
        <t>
EPP servers which implement this extension <bcp14>SHOULD</bcp14> use the values provided by EPP clients for the TTL values records published in the DNS for domain and and objects.
</t>
        <t>
EPP servers that use the "host attribute" model <bcp14>SHOULD</bcp14> use any <spanx style="verb">A</spanx> and/or <spanx style="verb">AAAA</spanx> TTL values specified for the domain object when publishing <spanx style="verb">NS</spanx>, <spanx style="verb">A</spanx> and <spanx style="verb">AAAA</spanx> records derived from host attributes.
</t>
      </section>
    </section>
    <section anchor="oob-changes" title="Out-of-band changes to TTL values">
      <t>
EPP server operators <bcp14>MAY</bcp14>, in order to address operational or security issues, make changes to TTL values out-of-band (that is, not in response to an <spanx style="verb">&lt;update&gt;</spanx> command received from the sponsoring client).
</t>
      <t>
Server operators <bcp14>MAY</bcp14> also implement automatic reset of TTL values, so that they revert to the default value a certain amount of time after an update has been made.
</t>
      <t>
If a TTL value is changed out-of-band, EPP server operators <bcp14>MAY</bcp14> notify the sponsoring client using the EPP Change Poll extension (<xref target="RFC8590"/>), which provides a generalised method for EPP servers to notify clients of changes to objects under their sponsorship.
</t>
    </section>
    <section anchor="operational-considerations" title="Operational considerations">
      <section title="Operational impact of TTL values">
        <t>
Domain registry operators must strike a balance between, on the one hand, the desire of registrants for changes to their domains to be visible in the DNS quickly, and on the other, the increased DNS query traffic that short TTLs can bring.
Historically, registry operators have used a global TTL value which was applied to all delegations within their zones, which could then be tuned to an optimum value.
</t>
        <t>
Domain registry operators <bcp14>SHOULD</bcp14> implement limits on the maximum and minimum accepted TTL values that are narrower than the values permitted in the XML schema in the <xref target="formal-syntax" format="title"/> (which were chosen to allow any TTL permitted in DNS records), in order to prevent scenarios where an excessively high or low TTL causes operational issues on either side of the zone cut.
</t>
        <t><xref target="oob-changes"/> describes how server operators <bcp14>MAY</bcp14> unilaterally change TTL values in order to address operational or security issues, or only permit changes for limited time periods (after which TTLs revert to the default).
</t>
      </section>
      <section title="When TTL values should be changed">
        <t>
A common operational mistake is changing of DNS record TTLs during or after the planned change to the records themselves.
This arises due to a misunderstanding about how TTLs work.
</t>
        <t>
Implementations of this specification <bcp14>SHOULD</bcp14> ensure that the user understands that changes to a TTL are only effective in shortening transition periods if implemented a period of time — at least equal to the current TTL — <em>before</em> the planned change.
</t>
      </section>
    </section>
    <section anchor="security-considerations" title="Security considerations">
      <t>
Some malicious actors use a technique called "fast flux DNS" (<xref target="SAC-025"/>) to rapidly change the DNS configuration for a zone in order to evade takedown and law enforcement activity.
</t>
      <t>
Registry operators <bcp14>SHOULD</bcp14> take this into consideration when setting the lower limit on TTL values, since a short TTL on delegations may enhance the effectiveness of fast flux techniques on evasion.
</t>
    </section>
    <section anchor="IANA" title="IANA considerations">
      <section title="XML namespace">
        <t>
This document uses URNs to describe XML namespaces and XML schemas conforming to a registry mechanism described in <xref target="RFC3688"/>.
The following URI assignment has been made by IANA:
</t>
        <t>
Registration for the TTL namespace:
</t>
        <list>
          <t>
            <strong>URI:</strong>
            <spanx style="verb">urn:ietf:params:xml:ns:epp:ttl-1.0</spanx>
          </t>
          <t><strong>Registrant Contact:</strong> See the author of this document
</t>
          <t><strong>XML:</strong> None. Namespace URIs do not represent an XML specification
</t>
        </list>
        <t>
Registration for the TTL XML schema:
</t>
        <list>
          <t>
            <strong>URI:</strong>
            <spanx style="verb">urn:ietf:params:xml:schema:epp:ttl-1.0</spanx>
          </t>
          <t><strong>Registrant Contact:</strong> See the author of this document
</t>
          <t><strong>XML:</strong> See the "<xref target="formal-syntax" format="title"/>" section of this document
</t>
        </list>
      </section>
      <section title="EPP extension registry">
        <t>
The EPP extension described in this document has been registered by the IANA in the Extensions for the "Extensible Provisioning Protocol (EPP)" registry described in <xref target="RFC7451"/>.
The details of the registration are as follows:
</t>
        <list>
          <t><strong>Name of Extension:</strong> Extensible Provisioning Protocol (EPP) Mapping for DNS Time-To-Live (TTL) values
</t>
          <t><strong>Document Status:</strong> Standards Track
</t>
          <t><strong>Reference:</strong> URL of this document
</t>
          <t><strong>Registrant Name and Email Address:</strong> See the author of this document
</t>
          <t><strong>TLDs:</strong> Any
</t>
          <t><strong>IPR Disclosure:</strong> None
</t>
          <t><strong>Status:</strong> Active
</t>
          <t><strong>Notes:</strong> None
</t>
        </list>
      </section>
    </section>
    <section anchor="formal-syntax" title="Formal syntax">
      <t>
The formal syntax presented here is a complete schema representation of the extension suitable for automated validation of EPP XML instances.
</t>
      <sourcecode>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;schema
  xmlns="http://www.w3.org/2001/XMLSchema"
  targetNamespace="urn:ietf:params:xml:ns:epp:ttl-1.0"
  xmlns:ttl="urn:ietf:params:xml:ns:epp:ttl-1.0"
  elementFormDefault="qualified"&gt;
  &lt;annotation&gt;
    &lt;documentation&gt;
      Extensible Provisioning Protocol v1.0 extension
      schema for Time-To-Live (TTL) values for domain
      and host objects.
    &lt;/documentation&gt;
  &lt;/annotation&gt;

  &lt;!--
    extension elements can appear in &lt;create&gt; and
    &lt;update&gt; commands, and &lt;info&gt; responses
  --&gt;

  &lt;element name="create" type="ttl:commandContainer"&gt;
    &lt;unique name="uniqueRRTypeForCreate"&gt;
      &lt;selector xpath="ttl:ttl"/&gt;
      &lt;field xpath="@for"/&gt;
    &lt;/unique&gt;
  &lt;/element&gt;

  &lt;element name="update" type="ttl:commandContainer"&gt;
    &lt;unique name="uniqueRRTypeForUpdate"&gt;
      &lt;selector xpath="ttl:ttl"/&gt;
      &lt;field xpath="@for"/&gt;
    &lt;/unique&gt;
  &lt;/element&gt;

  &lt;element name="infData" type="ttl:responseContainer"&gt;
    &lt;unique name="uniqueRRTypeForInfo"&gt;
      &lt;selector xpath="ttl:ttl"/&gt;
      &lt;field xpath="@for"/&gt;
    &lt;/unique&gt;
  &lt;/element&gt;

  &lt;complexType name="commandContainer"&gt;
    &lt;sequence&gt;
      &lt;element
        name="ttl"
        type="ttl:commandTTLType"
        minOccurs="1"
        maxOccurs="unbounded"/&gt;
    &lt;/sequence&gt;
  &lt;/complexType&gt;

  &lt;complexType name="responseContainer"&gt;
    &lt;sequence&gt;
      &lt;element
        name="ttl"
        type="ttl:responseTTLType"
        minOccurs="1"
        maxOccurs="unbounded"/&gt;
    &lt;/sequence&gt;
  &lt;/complexType&gt;

  &lt;complexType name="commandTTLType"&gt;
    &lt;simpleContent&gt;
      &lt;extension base="ttl:ttlOrNull"&gt;
        &lt;attribute
          name="for"
          type="ttl:rrType"
          use="required"/&gt;
      &lt;/extension&gt;
    &lt;/simpleContent&gt;
  &lt;/complexType&gt;

  &lt;complexType name="responseTTLType"&gt;
    &lt;simpleContent&gt;
      &lt;extension base="ttl:ttlOrNull"&gt;
        &lt;attribute
          name="for"
          type="ttl:rrType"
          use="required"/&gt;

        &lt;attribute
          name="custom"
          type="ttl:customRRType"/&gt;

        &lt;attribute
          name="min"
          type="ttl:ttlValue"
          use="required"/&gt;

        &lt;attribute
          name="default"
          type="ttl:ttlValue"
          use="required"/&gt;

        &lt;attribute
          name="max"
          type="ttl:ttlValue"
          use="required"/&gt;
      &lt;/extension&gt;
    &lt;/simpleContent&gt;
  &lt;/complexType&gt;

  &lt;!--
    union type allowing the element to either contain
    nothing or a TTL value
  --&gt;
  &lt;simpleType name="ttlOrNull"&gt;
    &lt;union
      memberTypes="ttl:emptyValue ttl:ttlValue"/&gt;
  &lt;/simpleType&gt;

  &lt;!-- empty value type --&gt;
  &lt;simpleType name="emptyValue"&gt;
    &lt;restriction base="token"&gt;
      &lt;length value="0"/&gt;
    &lt;/restriction&gt;
  &lt;/simpleType&gt;

  &lt;!-- TTL value type --&gt;
  &lt;simpleType name="ttlValue"&gt;
    &lt;restriction base="nonNegativeInteger"&gt;
      &lt;minInclusive value="0"/&gt;
      &lt;maxInclusive value="2147483647"/&gt;
    &lt;/restriction&gt;
  &lt;/simpleType&gt;

  &lt;!-- resource record mnemonic type --&gt;
  &lt;simpleType name="rrType"&gt;
    &lt;restriction base="token"&gt;
      &lt;enumeration value="NS" /&gt;
      &lt;enumeration value="DS" /&gt;
      &lt;enumeration value="DNAME" /&gt;
      &lt;enumeration value="A" /&gt;
      &lt;enumeration value="AAAA" /&gt;
      &lt;enumeration value="custom" /&gt;
    &lt;/restriction&gt;
  &lt;/simpleType&gt;

  &lt;!-- custom resource record type --&gt;
  &lt;simpleType name="customRRType"&gt;
    &lt;restriction base="token"&gt;
      &lt;pattern value="A|[A-Z][A-Z0-9\-]*[A-Z0-9]"/&gt;
    &lt;/restriction&gt;
  &lt;/simpleType&gt;
&lt;/schema&gt;
</sourcecode>
    </section>
    <section title="Implementation status" removeInRFC="true">
      <t>
None currently reported - if you have implemented this extension, please let me know!
</t>
    </section>
    <section title="Change log" anchor="change_log" removeInRFC="true">
      <section title="Change from 03 to 04">
        <ol>
          <li>
Changed the <spanx style="verb">for</spanx> attribute to be an enumeration and added the <spanx style="verb">custom</spanx> attribute.
</li>
          <li>
Added the <spanx style="verb">min</spanx>, <spanx style="verb">default</spanx> and <spanx style="verb">max</spanx> attributes.
</li>
          <li>
Apply feedback from Jim Gould.
</li>
        </ol>
      </section>
      <section title="Change from 02 to 03">
        <ol>
          <li>
Rolled back the "straw man" syntax from 02.
<spanx style="verb">ttl:ttl</spanx> now has a <spanx style="verb">for</spanx> attribute which can be any DNS record type.
<xref target="supported-dns-record-types"/> describes how the set of supported record types may be limited.
</li>
          <li>
Removed the global/explicit models and just use the explicit model.
</li>
          <li>
Removed the cascading effect where a TTL set on a domain affects subordinate hosts.
</li>
        </ol>
      </section>
      <section title="Change from 01 to 02">
        <ol>
          <li>
Renamed the <spanx style="verb">ttl:seconds</spanx> XSD type to <spanx style="verb">ttl:container</spanx>, and the <spanx style="verb">ttl:nonNegativeInteger</spanx> type to <spanx style="verb">ttl:ttlType</spanx>, to permit multiple TTL values.
</li>
          <li>
Converted XML instances from artwork to source code.
</li>
        </ol>
      </section>
      <section title="Change from 00 to 01">
        <ol>
          <li>
Incorporate feedback from Jim Gould.
</li>
          <li>
Add wording to describe how TTL values are jointly managed by both clients and servers.
</li>
          <li>
Fix minimum/maximum TTL value and schema namespace (thanks Patrick Mevzek).
</li>
          <li>
Moved text on how the server should handle impermissible TTL values from the top of Section 4 to Sections 3.2.1 and 3.2.2 (thanks Rick Wilhelm).
</li>
          <li>
Namespace changed from <spanx style="verb">urn:ietf:params:xml:ns:ttl-1.0</spanx> to <spanx style="verb">urn:ietf:params:xml:ns:epp:ttl-1.0</spanx>.
</li>
          <li>
Added discussion on EPP servers which use the host attribute model in <xref target="using_ttl_values"/> (thanks Hugo Salgado).
</li>
          <li>
Added a <xref target="change_log">Change Log</xref>.
</li>
        </ol>
      </section>
    </section>
    <section title="Acknowledgements">
      <t>
The author wishes to thank the following people for their advice and feedback during the development of this document:
</t>
      <ol>
        <li>Hugo Salgado;</li>
        <li>Patrick Mevzek;</li>
        <li>Rick Wilhelm;</li>
        <li>James Gould;</li>
        <li>Marc Groeneweg;</li>
        <li>Ties de Kock.</li>
      </ol>
    </section>
  </middle>
  <back>
    <references title="Normative references">
&RFC2119;
&RFC3688;
&RFC5731;
&RFC5732;
&RFC5910;
&RFC6895;
&RFC7451;
</references>
    <references title="Informative references">
&RFC6927;
&RFC8499;
&RFC8590;
&RFC9364;

<reference anchor="SAC-025" target="https://www.icann.org/en/system/files/files/sac-025-en.pdf"><front><title>SSAC Advisory on Fast Flux Hosting and DNS</title><author><organization>ICANN Security and Stability Advisory Committee (SSAC)</organization></author><date month="January" year="2008"/></front><seriesInfo name="SAC" value="25"/></reference>
</references>
  </back>
</rfc>
