<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!-- One method to get references from the online citation libraries.
     There has to be one entity for each item to be referenced. 
     An alternate method (rfc include) is described in the references. -->

<!ENTITY RFC1918 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.1918.xml">
<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC4034 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4034.xml">
<!ENTITY RFC5890 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5890.xml">
<!ENTITY RFC6761 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6761.xml">
<!ENTITY RFC7296 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7296.xml">
<!ENTITY RFC7435 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7435.xml">
<!ENTITY I-D.ietf-dnsop-onion-tld SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.draft-ietf-dnsop-onion-tld-01.xml">
]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!-- used by XSLT processors -->
<!-- For a complete list and description of processing instructions (PIs), 
     please see http://xml.resource.org/authoring/README.html. -->
<!-- Below are generally applicable Processing Instructions (PIs) that most I-Ds might want to use.
     (Here they are set differently than their defaults in xml2rfc v1.32) -->
<?rfc strict="yes" ?>
<!-- give errors regarding ID-nits and DTD validation -->
<!-- control the table of contents (ToC) -->
<?rfc toc="yes"?>
<!-- generate a ToC -->
<?rfc tocdepth="4"?>
<!-- the number of levels of subsections in ToC. default: 3 -->
<!-- control references -->
<?rfc symrefs="yes"?>
<!-- use symbolic references tags, i.e, [RFC2119] instead of [1] -->
<?rfc sortrefs="yes" ?>
<!-- sort the reference entries alphabetically -->
<!-- control vertical white space 
     (using these PIs as follows is recommended by the RFC Editor) -->
<?rfc compact="yes" ?>
<!-- do not start each main section on a new page -->
<?rfc subcompact="no" ?>
<!-- keep one blank line between list items -->
<!-- end of list of popular I-D processing instructions -->
<rfc ipr="trust200902"
    updates=""
    obsoletes=""
    category="std"
    docName="draft-pauly-ipsecme-split-dns-00">

  <!-- category values: std, bcp, info, exp, and historic -->

  <!-- ***** FRONT MATTER ***** -->

  <front>
    <!-- The abbreviated title is used in the page header - it is only necessary if the 
         full title is longer than 39 characters -->

    <title>Split-DNS Configuration for IKEv2 </title>

    <!-- add 'role="editor"' below for the editors if appropriate -->

    <author fullname="Tommy Pauly" initials="T." surname="Pauly">
      <organization>Apple Inc.</organization>

      <address>
        <postal>
          <street>1 Infinite Loop</street>
          <city>Cupertino</city>
          <region>California</region>
          <code>95014</code>
          <country>US</country>
        </postal>

        <phone></phone>
        <email>tpauly@apple.com</email>
      </address>
    </author>
    <author initials='P.' surname="Wouters" fullname='Paul Wouters'>
     <organization>Red Hat</organization>
     <address>
      <email>pwouters@redhat.com</email>
     </address>
    </author>

    <date/>

    <!-- If the month and year are both specified and are the current ones, xml2rfc will fill 
         in the current day for you. If only the current year is specified, xml2rfc will fill 
     in the current day and month for you. If the year is not the current one, it is 
     necessary to specify at least a month (xml2rfc assumes day="1" if not specified for the 
     purpose of calculating the expiry date).  With drafts it is normally sufficient to 
     specify just the year. -->

    <!-- Meta-data Declarations -->

    <area>General</area>

    <workgroup>Network</workgroup>

    <!-- WG name at the upperleft corner of the doc,
         IETF is fine for individual submissions.  
     If this element is not present, the default is "Network Working Group",
         which is used by the RFC Editor as a nod to the history of the IETF. -->

    <keyword>IKEv2</keyword>
    <keyword>DNS</keyword>

    <!-- Keywords will be incorporated into HTML output
         files in a meta tag but they have no effect on text or nroff
         output. If you submit your draft to the RFC Editor, the
         keywords will be used for the search engine. -->

    <abstract>
      <t>This document defines two new Configuration Payload Attribute Types for the IKEv2 protocol that together define a set of private DNS domains which should be resolved by DNS servers reachable through an IPsec connection, while leaving all other DNS resolution unchanged. This allows for split-DNS views for multiple domains and includes support for private DNSSEC trust anchors. The information obtained via the new attribute types can be used to reconfigure a locally running DNS server with DNS forwarding for specific private domains.</t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
      <t>The Internet Key Exchange protocol version 2 <xref target="RFC7296"/> negotiates configuration parameters using Configuration Payload Attribute Types. This document adds two new Configuration Payload Attribute Types to support trusted split-DNS domains. The INTERNAL_DNS_DOMAIN attribute type is used to convey one or more local DNS domains. The INTERNAL_DNSSEC_TA attribute type is used to convey DNSSEC trust anchors for those domains. When only a subset of traffic is routed into a private network using an IPSec SA, this Configuration Payload option can be used to define which private domains should be resolved through the IPSec connection without affecting the client's global DNS resolution. For the purposes of this document, DNS servers accessible through an IPsec connection will be referred to as "internal DNS servers", and other DNS servers will be referred to as "external DNS servers".</t>

      <t>A client using these configuration payloads will be able to request and receive split-DNS configurations using the INTERNAL_DNS_DOMAIN and INTERNAL_DNSSEC_TA configuration attributes. The client can use the internal DNS server(s) for any DNS queries within the assigned domains, while routing other DNS queries to its regular external DNS server.</t>

      <section title="Requirements Language">
        <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">RFC 2119</xref>.</t>
      </section>
    </section>

    <section title="Background">
      <t>Split-DNS is a common configuration for enterprise VPN deployments, in which only one or a few private DNS domains are accessible and resolvable via an IPsec based VPN connection.</t>
      <t>Other tunnel-establishment protocols already support the assignment of split-DNS domains. For example, there are proprietary extensions to IKEv1 that allow a server to assign split-DNS domains to a client. However, the IKEv2 standard does not include a method to configure this option. This document defines a standard way to negotiate this option for IKEv2.</t>
    </section>

    <section title="Protocol Exchange">
        <section title="Configuration Request">
        <t>To indicate support for split-DNS, initiators sending a CFG_REQUEST payload MAY include one or more of the INTERNAL_DNS_DOMAIN configuration attribute in their configuration payloads. See <xref target="payload_formats"/> for details on the payload format. If an INTERNAL_DNS_DOMAIN attribute is included in the CFG_REQUEST, the initiator SHOULD also include one or both of the INTERNAL_IP4_DNS and INTERNAL_IP6_DNS attributes in its CFG_REQUEST.</t>
        <t>If the attribute length is zero, then the initiator is only requesting that the attribute be assigned, without restricting the subdomains that it will accept.</t>
        <t>If the attribute length is non-zero, it contains a single DNS domain . The initiator is indicating that it will allow this domain and its sub-domains to be resolved over the IPsec connection. The list of INTERNAL_DNS_DOMAIN attributes in the CFG_REQUEST defines the full set of domains the intiator is willing to resolve over the tunnel.</t>
        </section>
        <section title="Configuration Reply">
            <t>Responders MAY send one or more INTERNAL_DNS_DOMAIN configuration attributes in their CFG_REPLY payload if the CFG_REQUEST contained at least one INTERNAL_DNS_DOMAIN configuration attribute. If the CFG_REQUEST did not contain an INTERNAL_DNS_DOMAIN configuration attribute, the responder MUST NOT include an INTERNAL_DNS_DOMAIN configuration attribute in the CFG_REPLY. If an INTERNAL_DNS_DOMAIN configuration attribute is included in the CFG_REPLY, the responder SHOULD also include one or both of the INTERNAL_IP4_DNS and INTERNAL_IP6_DNS configuration attributes in its CFG_REPLY. If the CFG_REQUEST included an INTERNAL_DNS_DOMAIN configuration attribute, but the CFG_REPLY does include an INTERNAL_DNS_DOMAIN attribute, the initiator should behave as if split-DNS configurations are not supported by the server.</t>
            <t>Each INTERNAL_DNS_DOMAIN represents a domain that the DNS servers address listed in INTERNAL_IP4_DNS and INTERNAL_IP6_DNS can resolve.</t>
            <t>If the CFG_REQUEST included INTERNAL_DNS_DOMAIN attributes with non-zero lengths, the CFG_REPLY MUST NOT assign any domains in its INTERNAL_DNS_DOMAIN attributes that are not contained within the requested domains. The initiator SHOULD ignore any domains beyond its requested list.</t>
            <t>For each DNS domain specified in an INTERNAL_DNS_DOMAIN configuration attribute, an INTERNAL_DNSSEC_TA configuration attribute may be included by the responder. This attribute lists the corresponding DSSNEC trust anchor in the presentation format of a DS record as specified in <xref target="RFC4034"/>.</t>
        </section>
     <section title="Mapping DNS Servers to Domains">
       <t>All DNS servers provided in the CFG_REPLY MUST support all domains. The INTERNAL_DNS_DOMAIN attributes in a CFG_REPLY payload form a single list of split-DNS domains, that apply to the entire list of INTERNAL_IP4_DNS and INTERNAL_IP6_DNS attributes.</t>
     </section>
        <section title="Example Exchanges">
        <section title="Simple Case">
            <t>In this example exchange, the initiator requests INTERNAL_IP4_DNS and INTERNAL_DNS_DOMAIN attributes in its CFG_REQUEST, but does not specify any value for either. This indicates that it supports split-DNS, but has no preference for which DNS requests should be routed through the tunnel.</t>
            <t>The responder replies with two DNS server addresses, and one internal domain, "example.com".</t>
            <t>Any subsequent DNS queries from the initiator for domains such as "www.example.com" should use 198.51.100.2 or 198.51.100.4 to resolve.</t>
            <figure align="center">
                <artwork align="left"><![CDATA[
CP(CFG_REQUEST) =
  INTERNAL_IP4_ADDRESS()
  INTERNAL_IP4_DNS()
  INTERNAL_DNS_DOMAIN()

CP(CFG_REPLY) =
  INTERNAL_IP4_ADDRESS(198.51.100.234)
  INTERNAL_IP4_DNS(198.51.100.2)
  INTERNAL_IP4_DNS(198.51.100.4)
  INTERNAL_DNS_DOMAIN(example.com)
                ]]></artwork>
            </figure>
        </section>
        <section title="Requesting Limited Domains">
            <t>In this example exchange, the initiator requests INTERNAL_IP4_DNS and INTERNAL_DNS_DOMAIN attributes in its CFG_REQUEST, specifically requesting only "example.com" and "other.com". The responder replies with two DNS server addresses, 198.51.100.2 and 198.51.100.4, and two domains, "example.com" and "city.other.com". Note that one of the domains in the CFG_REPLY, "city.other.com", is a subset of the requested domain, "other.com". This indicates that hosts within "other.com" that are not within "city.other.com" should be resolved using an external DNS server. The CFG_REPLY would not be allowed to respond with "com" or "example.net", however, since these were contained within the limited set of requested domains.</t>
            <t>Any subsequent DNS queries from the initiator for domains such as "www.example.com" or "city.other.com" should use 198.51.100.2 or 198.51.100.4 to resolve.</t>
            <figure align="center">
                <artwork align="left"><![CDATA[
CP(CFG_REQUEST) =
  INTERNAL_IP4_ADDRESS()
  INTERNAL_IP4_DNS()
  INTERNAL_DNS_DOMAIN(example.com)
  INTERNAL_DNS_DOMAIN(other.com)

CP(CFG_REPLY) =
  INTERNAL_IP4_ADDRESS(198.51.100.234)
  INTERNAL_IP4_DNS(198.51.100.2)
  INTERNAL_IP4_DNS(198.51.100.4)
  INTERNAL_DNS_DOMAIN(example.com)
  INTERNAL_DNS_DOMAIN(city.other.com)
                ]]></artwork>
            </figure>
        </section>
        </section>
    </section>

    <section title="Payload Formats" anchor="payload_formats">

    <section title="INTERNAL_DNS_DOMAIN Configuration Attribute Type" anchor="internal_domain">
        <figure align="center">
            <artwork align="left"><![CDATA[
                    1                   2                   3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|R|         Attribute Type      |            Length             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                          Domain Name                          ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
            ]]></artwork>

        </figure>

        <t><list style="symbols">
            <t>Reserved (1 bit) - Defined in IKEv2 RFC <xref target="RFC7296"/>.</t>
            <t>Attribute Type (15 bits) [TBD IANA] - INTERNAL_DNS_DOMAIN.</t>
            <t>Length (2 octets, unsigned integer) - Length of domain name.</t>
            <t>Domain Name (0 or more octets) - A domain or subdomain used for split-DNS rules, such as example.com. This is a string of ASCII characters with labels separated by dots, with no trailing dot, using IDNA <xref target="RFC5890"/> for non-ASCII DNS domains. The value is NOT null-terminated.</t>

        </list></t>
      </section>

    <section title="INTERNAL_DNSSEC_TA Configuration Attribute" anchor="internal_dnssec">
        <figure align="center">
            <artwork align="left"><![CDATA[
                    1                   2                   3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|R|         Attribute Type      |            Length             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
~                     DNSSEC TRUST ANCHOR                       ~
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
            ]]></artwork>

        </figure>

        <t><list style="symbols">
            <t>Reserved (1 bit) - Defined in IKEv2 RFC <xref target="RFC7296"/>.</t>
            <t>Attribute Type (15 bits) [TBD IANA] - INTERNAL_DNSSEC_TA.</t>
            <t>Length (2 octets, unsigned integer) - Length of DNSSEC Trust Anchor data.</t>
            <t>DNSSEC Trust anchor (multiple octets) - The presentation format of one DS record as specified in <xref target="RFC4034"/>. The TTL value MAY be omited and when present MUST be ignored. The domain name is specified as a Fully Qualified Domain Name (FQDN) - irrespective of the presence of a trailing dot, and consits of a string of ASCII characters with labels separated by dots and uses IDNA <xref target="RFC5890"/> for non-ASCII DNS domains. The value is NOT null-terminated. </t>
        </list></t>
      </section>
      </section>

<section title="Split-DNS Usage Guidelines">
    <t>If a CFG_REPLY payload contains no INTERNAL_DNS_DOMAIN configuration attributes, the client MAY use the provided INTERNAL_IP4_DNS or INTERNAL_IP6_DNS servers as the default DNS
server(s) for all queries.</t>
    <t>For each INTERNAL_DNS_DOMAIN entry in a CFG_REPLY payload, the client SHOULD use the provided INTERNAL_IP4_DNS or INTERNAL_IP6_DNS DNS servers as the only resolvers for the listed domains and its sub-domains and it SHOULD NOT attempt to resolve the provided DNS domains using its external DNS servers.</t>
    <t>If the initiator host is configured to block DNS answers containing IP addresses from special IP address ranges such as those of <xref target="RFC1918"/>, the initiator SHOULD allow the DNS domains listed in the INTERNAL_DNS_DOMAIN configuration attributes to contain these IP addresses.</t>
    <t>If a CFG_REPLY contains one or more INTERNAL_DNS_DOMAIN configuration attributes, the client SHOULD configure its DNS resolver to resolve those domains and all their subdomains using only the DNS resolver(s) listed in that CFG_REPLY message. If those resolvers fail, those names SHOULD NOT be resolved using any other DNS resolvers. All other domain names SHOULD be resolved using some other external DNS resolver(s), configured independently, and SHOULD NOT be sent to the internal DNS resolver(s) listed in that CFG_REPLY message. For example, if the INTERNAL_DNS_DOMAIN configuration attribute specifies "example.com", then "example.com", "www.example.com" and "mail.eng.example.com" SHOULD be resolved using the internal DNS resolver(s), but "anotherexample.com" and "ample.com" SHOULD be resolved using the system's external DNS resolver(s).</t>
    <t>An initiator MAY ignore INTERNAL_DNS_DOMAIN configuration attributes containing domains that are designated Special Use Domain Names in <xref target="RFC6761"/>, such as "local", "localhost", "invalid", etc. Although it may explicitly wish to support some Special Use Domain Names, for example "onion" <xref target="I-D.ietf-dnsop-onion-tld"/>.</t>
    <t>When an IPsec connection is terminated, the DNS forwarding must be unconfigured. The DNS forwarding itself MUST be be deleted. All cached data of the INTERNAL_DNS_DOMAIN provided DNS domainis MUST be flushed. This includes negative cache entries. Obtained DNSSEC trust anchors MUST be removed from the list of trust anchors. The outstanding DNS request queue MAY be cleared. </t>
    <t>A domain that is served via INTERNAL_DNS_DOMAIN MUST NOT have indirect references to DNS records that point to other split-DNS domains that are not served via INTERNAL_DNS_DOMAIN configuration attributes. Indirect reference resource record types include CNAME, DNAME, MX and SRV resource records.</t>
    <t>INTERNAL_DNS_DOMAIN and INTERNAL_DNSSEC_TA configuration attributes should only be used on split-tunnel configurations where only a subset of traffic is routed into a private remote network using the IPSec connection. If all traffic is routed over the IPsec connection, the existing global INTERNAL_IP4_DNS and INTERNAL_IP6_DNS can be used without creating specific DNS excemptions.</t>

</section>

<section anchor="Security" title="Security Considerations">
    <t>The use of split-DNS configurations assigned by an IKEv2 responder is predicated on the trust established during IKE SA authentication. However, if IKEv2 is being negotiated with an anonymous or unknown endpoint (such as for Opportunistic Security <xref target="RFC7435"/>), the initiator MUST ignore split-DNS configurations assigned by the responder.</t>
    <t>If a host connected to an authenticated IKE peer is connecting to another IKE peer that attempts to claim the same domain via the INTERNAL_DNS_DOMAIN configuration attribute,
       the IKE connection should be terminated.</t>
    <t>If the IP address value of the received INTERNAL_IP4_DNS or INTERNAL_IP6_DNS configuration attribute is not covered by the proposed IPsec connection, then the local DNS should not
       be reconfigured until a CREATE_CHILD Exchange is receiver that covers these IP addresses.</t>
    <t>INTERNAL_DNSSEC_TA directives MUST have an accompanying INTERNAL_DNS_DOMAIN directive. This prevents the insertion of rogue DNSSEC trust anchors for domains that have not
       been yielded to the IPsec connection.</t>
</section>

    <section anchor="IANA" title="IANA Considerations">
        <t>This document defines two new IKEv2 Configuration Payload Attribute Types, which are allocated from the "IKEv2 Configuration Payload
   Attribute Types" namespace.</t>
        <figure align="center" anchor="iana_requests">
            <artwork align="left"><![CDATA[
                                 Multi-
Value    Attribute Type       Valued  Length      Reference
------   -------------------  ------  ----------  ---------------
[TBD]    INTERNAL_DNS_DOMAIN   YES     0 or more  [this document]
[TBD]    INTERNAL_DNSSEC_TA    YES     0 or more  [this document]
            ]]></artwork>
        </figure>
    </section>


  </middle>

  <!--  *****BACK MATTER ***** -->

  <back>
    <!-- References split into informative and normative -->

    <!-- There are 2 ways to insert reference entries from the citation libraries:
     1. define an ENTITY at the top, and use "ampersand character"RFC2629; here (as shown)
     2. simply use a PI "less than character"?rfc include="reference.RFC.2119.xml"?> here
        (for I-Ds: include="reference.I-D.narten-iana-considerations-rfc2434bis.xml")

     Both are cited textually in the same manner: by using xref elements.
     If you use the PI option, xml2rfc will, by default, try to find included files in the same
     directory as the including file. You can also define the XML_LIBRARY environment variable
     with a value containing a set of directories to search.  These can be either in the local
     filing system or remote ones accessed by http (http://domain/dir/... ).-->

    <references title="Normative References">
     &RFC1918;
     &RFC2119;
     &RFC4034;
     &RFC5890;
     &RFC7296;
    </references>

    <references title="Informative References">
      &RFC6761;
      &RFC7435;
	  &I-D.ietf-dnsop-onion-tld;
    </references>
  </back>
</rfc>
