<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">

<?rfc rfcedstyle="yes" ?>
<?rfc compact="yes" ?>
<?rfc subcompact="no" ?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes" ?>
<?rfc toc="yes" ?>

<rfc number="7314" submissionType="independent" ipr="trust200902" category="exp">
  <front>

    <title>Extension Mechanisms for DNS (EDNS) EXPIRE Option</title>
    <author initials="M.P." surname="Andrews" fullname="Mark P. Andrews">
      <organization abbrev="ISC">Internet Systems Consortium</organization>
      <address>
	<postal>
	  <street>950 Charter Street</street>
	  <city>Redwood City</city>
	  <region>CA</region>
	  <code>94063</code>
	  <country>US</country>
	</postal>
	<email>marka@isc.org</email>
      </address>
    </author>
    <date month="July" year="2014"/>

    <abstract>
      <t>
	This document specifies a method for secondary DNS servers to
	honour the SOA EXPIRE field as if they were always transferring
	from the primary, even when using other secondaries to perform
	indirect transfers and refresh queries.
      </t>
    </abstract>
  </front>

  <middle>
    <section anchor="intro" title="Introduction">
      <t>
	The expire field of a DNS zone's SOA record <xref
	target="RFC1035" /> is supposed to indicate when a secondary
	server shall discard the contents of the zone when it has
	been unable to contact the primary <xref target="RFC1034"
	/>.  Current practice only works when all the secondaries contact
	the primary directly to perform refresh queries and zone
	transfers.
      </t>

      <t>
	While secondaries are expected to be able to, and often are
	configured to, transfer from other secondaries for robustness
	reasons as well as reachability constraints, there is no
	mechanism provided to preserve the expiry behaviour when
	using a secondary.  Instead, secondaries have to know whether
	they are talking directly to the primary or another
	secondary and use that to decide whether or not to update the
	expire timer.  This, however, fails to take into account
	delays in transferring from one secondary to another.
      </t>

      <t>
	There are also zone-transfer graphs in which the secondary never
	talks to the primary, so the effective expiry period becomes
	multiplied by the length of the zone-transfer graph, which is infinite
	when it contains loops.
      </t>

      <t>
	This document provides a mechanism to preserve the expiry
	behaviour regardless of what zone-transfer graph is constructed
	and whether the secondary is talking to the primary or another
	secondary.
      </t>

      <section anchor="reserved" title="Reserved Words">
	<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>
      </section>
    </section>

    <section anchor="query" title="Expire EDNS Option (Query)">
      <t>
	The EDNS <xref target="RFC6891" /> EXPIRE option has the
	value &lt;9&gt;.  The EDNS EXPIRE option MAY be included on any QUERY,
	though usually this is only done on SOA, AXFR,
	and IXFR queries involved in zone maintenance.  This is
	done by adding a zero-length EDNS EXPIRE option to the
	options field of the OPT record when the query is made.
      </t>
    </section>

    <section anchor="response" title="Expire EDNS Option (Response)">
      <section anchor="primary" title="Primary Server">
	<t>
	  When the query is directed to the primary server for the
	  zone, the response will be an EDNS EXPIRE option of length
	  4 containing the value of the SOA EXPIRE field, in seconds
	  and network byte order.
	</t>
      </section>

      <section anchor="secondary" title="Secondary Server">
	<t>
	  When the query is directed to a secondary server for the
	  zone, then the response will be an EDNS EXPIRE option of
	  length 4 containing the value of the expire timer on that
	  server, in seconds and network byte order.
	</t>
      </section>

      <section anchor="recursive" title="Non-authoritative Server">
	<t>
	  If an EDNS EXPIRE option is sent to a server that is not
	  authoritative for the zone, it MUST NOT add an EDNS EXPIRE
	  option to the response.
	</t>
      </section>
    </section>

    <section anchor="update" title="Secondary Behaviour">
      <t>
	When a secondary server performs a zone-transfer request
	or a zone-refresh query, it SHALL add an EDNS EXPIRE
	option to the query message.
      </t>

      <t>
	If a secondary receives an EDNS EXPIRE option in a response
	to an SOA query, it SHALL update its expire timer to be the
	maximum of the value returned in the EDNS EXPIRE option and
	the current timer value.  Similarly, if a secondary receives
	an EDNS EXPIRE option in its response to an IXFR query that
	indicated the secondary is up to date (serial matches current
	serial), the secondary SHALL update the expire timer to be
	the maximum of the value returned in the EDNS EXPIRE option
	and the current timer value.
      </t>

      <t>
	If the zone is transferred or updated as the result of an AXFR or
	IXFR query and there is an EDNS EXPIRE option with the response, then
	the value of the EDNS EXPIRE option SHOULD be used instead of
	the value of the SOA EXPIRE field to initialise the expire timer.
      </t>

      <t>
	In all cases, if the value of the SOA EXPIRE field is less than the
	value of the EDNS EXPIRE option, then the value of the SOA EXPIRE
	field MUST be used and MUST be treated as a maximum when
	updating or initialising the expire timer.
      </t>
    </section>

    <section anchor="iana" title="IANA Considerations">
      <t>
	IANA has assigned an EDNS option code point 
	for the EDNS EXPIRE option specified
	in <xref target="query" /> with "Optional" status in the "DNS EDNS0
	Option Codes (OPT)" registry.
      </t>
    </section>

    <section anchor="security" title="Security Considerations">
      <t>
The method described in this document ensures that servers that no longer have
a connection to the primary server, direct or indirectly, cease serving the
zone content when SOA EXPIRE timer is reached. This prevents stale
	data from being served indefinitely.
      </t>
      <t>
	The EDNS EXPIRE option exposes how long the secondaries have
	been out of communication with the primary server.  This is
	not believed to be a problem and may provide some benefit
	to monitoring systems.
      </t>
    </section>
  </middle>

  <back>
    <references title="Normative References">

<reference anchor='RFC1034'>

<front>
<title abbrev='Domain Concepts and Facilities'>Domain names - concepts and facilities</title>
<author initials='P.' surname='Mockapetris' fullname='P. Mockapetris'>
<organization>Information Sciences Institute (ISI)</organization></author>
<date year='1987' day='1' month='November' /></front>

<seriesInfo name='STD' value='13' />
<seriesInfo name='RFC' value='1034' />
<format type='TXT' octets='129180' target='http://www.rfc-editor.org/rfc/rfc1034.txt' />
</reference>


<reference anchor='RFC1035'>

<front>
<title abbrev='Domain Implementation and Specification'>Domain names - implementation and specification</title>
<author initials='P.' surname='Mockapetris' fullname='P. Mockapetris'>
<organization>USC/ISI</organization>
<address>
<postal>
<street>4676 Admiralty Way</street>
<city>Marina del Rey</city>
<region>CA</region>
<code>90291</code>
<country>US</country></postal>
<phone>+1 213 822 1511</phone></address></author>
<date year='1987' day='1' month='November' /></front>

<seriesInfo name='STD' value='13' />
<seriesInfo name='RFC' value='1035' />
<format type='TXT' octets='125626' target='http://www.rfc-editor.org/rfc/rfc1035.txt' />
</reference>


<reference anchor='RFC2119'>

<front>
<title abbrev='RFC Key Words'>Key words for use in RFCs to Indicate Requirement Levels</title>
<author initials='S.' surname='Bradner' fullname='Scott Bradner'>
<organization>Harvard University</organization>
<address>
<postal>
<street>1350 Mass. Ave.</street>
<street>Cambridge</street>
<street>MA 02138</street></postal>
<phone>- +1 617 495 3864</phone>
<email>sob@harvard.edu</email></address></author>
<date year='1997' month='March' />
<area>General</area>
<keyword>keyword</keyword>
<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.  Authors who follow these guidelines
   should incorporate this phrase near the beginning of their document:

<list>
<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
      RFC 2119.
</t></list></t>
<t>
   Note that the force of these words is modified by the requirement
   level of the document in which they are used.
</t></abstract></front>

<seriesInfo name='BCP' value='14' />
<seriesInfo name='RFC' value='2119' />
<format type='TXT' octets='4723' target='http://www.rfc-editor.org/rfc/rfc2119.txt' />
<format type='HTML' octets='17970' target='http://xml.resource.org/public/rfc/html/rfc2119.html' />
<format type='XML' octets='5777' target='http://xml.resource.org/public/rfc/xml/rfc2119.xml' />
</reference>


<reference anchor='RFC6891'>

<front>
<title>Extension Mechanisms for DNS (EDNS(0))</title>
<author initials='J.' surname='Damas' fullname='J. Damas'>
<organization /></author>
<author initials='M.' surname='Graff' fullname='M. Graff'>
<organization /></author>
<author initials='P.' surname='Vixie' fullname='P. Vixie'>
<organization /></author>
<date year='2013' month='April' />
<abstract>
<t>The Domain Name System's wire protocol includes a number of fixed fields whose range has been or soon will be exhausted and does not allow requestors to advertise their capabilities to responders. This document describes backward-compatible mechanisms for allowing the protocol to grow.&lt;/t>&lt;t> This document updates the Extension Mechanisms for DNS (EDNS(0)) specification (and obsoletes RFC 2671) based on feedback from deployment experience in several implementations. It also obsoletes RFC 2673 ("Binary Labels in the Domain Name System") and adds considerations on the use of extended labels in the DNS.</t></abstract></front>

<seriesInfo name='STD' value='75' />
<seriesInfo name='RFC' value='6891' />
<format type='TXT' octets='32856' target='http://www.rfc-editor.org/rfc/rfc6891.txt' />
</reference>



    </references>
  </back>
</rfc>
