<?xml version="1.0" encoding="utf-8"?>
  <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
  <!-- generated by https://github.com/cabo/kramdown-rfc2629 version 1.0.31 -->

<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY RFC1035 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.1035.xml">
<!ENTITY RFC2119 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC8174 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml">
<!ENTITY RFC2845 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2845.xml">
<!ENTITY RFC2931 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2931.xml">
<!ENTITY RFC6973 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6973.xml">
<!ENTITY RFC7858 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7858.xml">
<!ENTITY RFC7871 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7871.xml">
<!ENTITY RFC8094 SYSTEM "http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8094.xml">
]>

<?rfc toc="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>

<rfc ipr="trust200902" docName="draft-bellis-dnsop-xpf-02" category="std" updates="RFC 2845, RFC 2931 (if approved)">

  <front>
    <title>DNS X-Proxied-For</title>

    <author initials="R." surname="Bellis" fullname="Ray Bellis">
      <organization abbrev="ISC">Internet Systems Consortium, Inc.</organization>
      <address>
        <postal>
          <street>950 Charter Street</street>
          <city>Redwood City</city>
          <code>CA 94063</code>
          <country>USA</country>
        </postal>
        <phone>+1 650 423 1200</phone>
        <email>ray@isc.org</email>
      </address>
    </author>
    <author initials="P." surname="van Dijk" fullname="Peter van Dijk">
      <organization abbrev="PowerDNS">PowerDNS.COM B.V.</organization>
      <address>
        <postal>
          <street></street>
          <city>Den Haag</city>
          <code></code>
          <country>The Netherlands</country>
        </postal>
        <phone></phone>
        <email>peter.van.dijk@powerdns.com</email>
      </address>
    </author>
    <author initials="R." surname="Gacogne" fullname="Rémi Gacogne">
      <organization abbrev="PowerDNS">PowerDNS.COM B.V.</organization>
      <address>
        <postal>
          <street></street>
          <city>Den Haag</city>
          <code></code>
          <country>The Netherlands</country>
        </postal>
        <phone></phone>
        <email>remi.gacogne@powerdns.com</email>
      </address>
    </author>

    <date year="2017" month="July" day="03"/>

    <area>Internet</area>
    <workgroup>DNSOP Working Group</workgroup>
    <keyword>Internet-Draft</keyword>

    <abstract>


<t>It is becoming more commonplace to install front end proxy devices in
front of DNS servers to provide (for example) load balancing or to
perform transport layer conversions.</t>

<t>This document defines a meta resource record that allows a DNS server to
receive information about the client’s original transport protocol
parameters when supplied by trusted proxies.</t>



    </abstract>


  </front>

  <middle>


<section anchor="introduction" title="Introduction">

<t>It is becoming more commonplace to install front end proxy devices in
front of DNS servers <xref target="RFC1035"/> to provide load balancing or to
perform transport layer conversions (e.g. to add DNS over TLS
<xref target="RFC7858"/> to a DNS server that lacks native support).</t>

<t>This has the unfortunate side effect of hiding the clients’ source IP
addresses from the server, making it harder to employ server-side
technologies that rely on knowing those addresses (e.g. ACLs, DNS Response
Rate Limiting, etc).</t>

<t>This document defines a DNS meta resource record (RR) that allows a DNS
server to receive information about the client’s original transport
protocol parameters when supplied by trusted proxies.</t>

<t>Whilst in some circumstances it would be possible to re-use the Client
Subnet EDNS Option <xref target="RFC7871"/> to carry a subset of this information, a
new RR is defined to allow both this feature and the Client Subnet
Option to co-exist in the same packet.</t>

</section>
<section anchor="terminology" title="Terminology">

<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>

<t>The word “proxy” in this document means a network component that sits on
the inbound query path in front of a recursive or authoritative DNS
server, receiving DNS queries from clients and dispatching them to local
servers.  This is to distinguish these from a “forwarder” since that
term is usually understood to describe a network component that sits on
the outbound query path of a client.</t>

</section>
<section anchor="description" title="Description">

<t>The XPF RR contains the entire 5-tuple of (protocol, source address,
destination address, source port and destination port) of the packet
received from the client by the proxy.</t>

<t>The presence of the source address supports use of ACLs based on the
client’s IP address.</t>

<t>The source port allows for ACLs to support Carrier Grade NAT whereby
different end-users might share a single IP address.</t>

<t>The destination address supports scenarios where the server behaviour
depends upon the packet destination (e.g. BIND view’s
“match-destinations” option)</t>

<t>The protocol and destination port fields allow server behaviour to vary
depending on whether DNS over TLS <xref target="RFC7858"/> or DNS over DTLS
<xref target="RFC8094"/> are in use.</t>

<section anchor="proxy-processing" title="Proxy Processing">

<t>Proxies MUST append this RR to the Additional Section of each request
packet received (and update the ARCOUNT field accordingly) before
sending it to the intended DNS server.</t>

<t>If this RR is already present in an incoming request it MUST be stripped
from the request unless the request was received from an upstream proxy
that is itself white-listed by the receiving proxy (i.e. if the proxies
are configured in a multi-tier architecture), in which case the original
value the RRs MUST be preserved.</t>

<t>Where multiple XPF RRs to appear in a request their ordering MUST also
be preserved.</t>

<t>« TODO: what about truncation on the client -&gt; server path? »</t>

</section>
<section anchor="server-processing" title="Server Processing">

<t>When this RR is received from a white-listed client the DNS server
SHOULD use the transport information contained therein in preference to
the packet’s own transport information for any data processing logic
(e.g.  ACLs) that would otherwise depend on the latter.</t>

<t>If this RR is received from a non-white-listed client the server MUST
return a REFUSED response.</t>

<t>If a server finds this RR anywhere other than in the Additional Section
of a request it MUST return a REFUSED response.</t>

<t>If the value of the RR’s IP version field is not understood by the
server it MUST return a REFUSED response.</t>

<t>If the length of the IP addresses contained in the RR are not consistent
with that expected for the given IP version then the server MUST return
a FORMERR response.</t>

<t>Servers MUST NOT send this RR in DNS responses.</t>

</section>
<section anchor="wire" title="Wire Format">

<t>The XPF RR is formatted like any standard RR, but none of the fields
except RDLENGTH and RDATA have any meaning in this specification.  All
multi-octet fields are transmitted in network order (i.e. big-endian).</t>

<t>The required values of the RR header fields are as follows:</t>

<t>NAME: MUST contain a single 0 octet (i.e. the root domain).</t>

<t>TYPE: MUST contain TBD1 (XPF).</t>

<t>CLASS: MUST contain 1 (IN).</t>

<t>TTL: MUST contain 0 (zero).</t>

<t>RDLENGTH: specifies the length in octets of the RDATA field.</t>

<t>The RDATA of the XPF RR is as follows:</t>

<figure><artwork><![CDATA[
                +0 (MSB)                            +1 (LSB)
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
0: |     Unused    |   IP Version  |           Protocol            |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
2: |     Source Address Octet 0    |              ...              |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
   |              ...             ///                              |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
   |  Destination Address Octet 0  |              ...              |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
   |              ...             ///                              |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
   |                          Source Port                          |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
   |                        Destination Port                       |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
]]></artwork></figure>

<t>Unused: Currently reserved.  These bits MUST be zero unless redefined in
a subsequent specification.</t>

<t>IP Version: The IP protocol version number used by the client, as
defined in the IANA IP Version Number Registry <xref target="IANA-IP"/>.
Implementations MUST support IPv4 (4) and IPv6 (6).</t>

<t>Protocol: The Layer 4 protocol number (e.g. UDP or TCP) as defined in
the IANA Protocol Number Registry <xref target="IANA-PROTO"/>.</t>

<t>Source Address: The source IP address of the client.</t>

<t>Destination Address: The destination IP address of the request, i.e. the
IP address of the proxy on which the request was received.</t>

<t>Source Port: The source port used by the client.</t>

<t>Destination Port: The destination port of the request.</t>

<t>The length of the Source Address and Destination Address fields will be
variable depending on the IP Version in use.</t>

</section>
<section anchor="presentation-format" title="Presentation Format">

<t>Since this is a “meta” RR that cannot appear in master format zone files
no presentation format is defined.</t>

</section>
<section anchor="signed" title="  Signed DNS Requests">

<t>Any XPF RRs found in a packet MUST be ignored for the purposes of
verifying any signatures used for Secret Key Transaction Authentication
for DNS <xref target="RFC2845"/> or DNS Request and Transaction Signatures (SIG(0))
<xref target="RFC2931"/>.</t>

<t>Similarly, if either TSIG or SIG(0) are configured between the proxy and
server then any XPF RRs MUST be ignored when the proxy calculates the
packet signature.</t>

</section>
</section>
<section anchor="security" title="Security Considerations">

<t>If the white-list of trusted proxies is implemented as a list of IP
addresses, the server administrator MUST have the ability to selectively
disable this feature for any transport where there is a possibility of
the proxy’s source address being spoofed.</t>

<t>This does not mean to imply that use over UDP is impossible - if for
example the network architecture keeps all proxy-to-server traffic on a
dedicated network and clients have no direct access to the servers then
the proxies’ source addresses can be considered unspoofable.</t>

</section>
<section anchor="privacy-considerations" title="Privacy Considerations">

<t>Used incorrectly, this RR could expose internal network information,
however it is not intended for use on proxy / forwarder devices that sit
on the client-side of a DNS request.</t>

<t>This specification is only intended for use on server-side proxy devices
that are under the same administrative control as the DNS servers
themselves.  As such there is no change in the scope within which any
private information might be shared.</t>

<t>Use other than as described above would be contrary to the principles of
<xref target="RFC6973"/>.</t>

</section>
<section anchor="iana-considerations" title="IANA Considerations">

<t>« a copy of the RFC 6895 IANA RR TYPE application template will appear here »</t>

</section>
<section anchor="acknowledgements" title="Acknowledgements">

<t>Mark Andrews, Robert Edmonds, Duane Wessels</t>

</section>


  </middle>

  <back>

    <references title='Normative References'>

<reference anchor="IANA-IP" target="http://www.iana.org/assignments/version-numbers/">
  <front>
    <title>IANA IP Version Registry</title>
    <author >
      <organization>IANA</organization>
    </author>
    <date year="n.d."/>
  </front>
</reference>
<reference anchor="IANA-PROTO" target="http://www.iana.org/assignments/protocol-numbers/">
  <front>
    <title>IANA Protocol Number Registry</title>
    <author >
      <organization>IANA</organization>
    </author>
    <date year="n.d."/>
  </front>
</reference>
&RFC1035;
&RFC2119;
&RFC8174;
&RFC2845;
&RFC2931;
&RFC6973;


    </references>

    <references title='Informative References'>

&RFC7858;
&RFC7871;
&RFC8094;


    </references>



  </back>
</rfc>

