Network Working Group                                         P. Hoffman
Internet-Draft                                                     ICANN
Intended status: Standards Track                              P. McManus
Expires: December 8, 2017                                        Mozilla
                                                           June 06, 2017


                         DNS Queries over HTTPS
                     draft-hoffman-dns-over-https-01

Abstract

   DNS queries sometimes experience problems with end to end
   connectivity at times and places where HTTPS flows freely.

   HTTPS provides the most practical mechanism for reliable end to end
   communication.  Its use of TLS provides integrity and confidentiality
   guarantees and its use of HTTP allows it to interoperate with
   proxies, firewalls, and authentication systems where required for
   transit.

   This document describes how to run DNS service over HTTP using
   https:// URIs.

   [ This paragraph is to be removed when this document is published as
   an RFC ] Comments on this draft can be sent to the DNS over HTTP
   mailing list at https://www.ietf.org/mailman/listinfo/dnsoverhttp .

Status of This Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list of current Internet-
   Drafts is at http://datatracker.ietf.org/drafts/current/.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   This Internet-Draft will expire on December 8, 2017.







Hoffman & McManus       Expires December 8, 2017                [Page 1]


Internet-Draft           DNS Queries over HTTPS                June 2017


Copyright Notice

   Copyright (c) 2017 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (http://trustee.ietf.org/license-info) in effect on the date of
   publication of this document.  Please review these documents
   carefully, as they describe your rights and restrictions with respect
   to this document.  Code Components extracted from this document must
   include Simplified BSD License text as described in Section 4.e of
   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2
   2.  Terminology . . . . . . . . . . . . . . . . . . . . . . . . .   3
   3.  Use Cases . . . . . . . . . . . . . . . . . . . . . . . . . .   3
   4.  Protocol Requirements . . . . . . . . . . . . . . . . . . . .   4
     4.1.  Non-requirements  . . . . . . . . . . . . . . . . . . . .   4
   5.  The HTTP Request  . . . . . . . . . . . . . . . . . . . . . .   4
     5.1.  DNS Wire Format . . . . . . . . . . . . . . . . . . . . .   5
     5.2.  Examples  . . . . . . . . . . . . . . . . . . . . . . . .   6
   6.  The HTTP Response . . . . . . . . . . . . . . . . . . . . . .   6
     6.1.  Example . . . . . . . . . . . . . . . . . . . . . . . . .   7
   7.  HTTP Integration  . . . . . . . . . . . . . . . . . . . . . .   7
   8.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .   8
     8.1.  Registration of Well-Known URI  . . . . . . . . . . . . .   8
     8.2.  Registration of application/dns-udpwireformat Media Type    8
   9.  Security Considerations . . . . . . . . . . . . . . . . . . .  10
   10. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . .  10
   11. References  . . . . . . . . . . . . . . . . . . . . . . . . .  10
     11.1.  Normative References . . . . . . . . . . . . . . . . . .  10
     11.2.  Informative References . . . . . . . . . . . . . . . . .  11
   Appendix A.  Previous Work on DNS over HTTP or in Other Formats .  12
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  12

1.  Introduction

   The Internet does not always provide end to end reachability for
   native DNS.  On-path network devices may spoof DNS responses, block
   DNS requests, or just redirect DNS queries to different DNS servers
   that give less-than-honest answers.

   Over time, there have been many proposals for using HTTP and HTTPS as
   a substrate for DNS queries and responses.  To date, none of those



Hoffman & McManus       Expires December 8, 2017                [Page 2]


Internet-Draft           DNS Queries over HTTPS                June 2017


   proposals have made it beyond early discussion, partially due to
   disagreement about what the appropriate formatting should be and
   partially because they did not follow HTTP best practices.

   This document defines a specific protocol for sending DNS [RFC1035]
   queries and getting DNS responses over modern versions of HTTP
   [RFC7540] using https:// (and therefore TLS [RFC5246] security for
   integrity and confidentiality).

   The described approach is more than a tunnel over HTTP.  It
   establishes default media formatting types for requests and responses
   but uses normal HTTP content negotiation mechanisms for selecting
   alternatives that endpoints may prefer in anticipation of serving new
   use cases.  In addition to this media type negotiation, it aligns
   itself with HTTP features such as caching, proxying, and compression.

   The integration with HTTP provides a transport suitable for both
   traditional DNS clients and native web applications seeking access to
   the DNS.

2.  Terminology

   A server that supports this protocol is called a "DNS API server" to
   differentiate it from a "DNS server" (one that uses the regular DNS
   protocol).  Similarly, a client that supports this protocol is called
   a "DNS API client".

   In this document, the key words "MUST", "MUST NOT", "REQUIRED",
   "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY",
   and "OPTIONAL" are to be interpreted as described in BCP 14, RFC 2119
   [RFC2119].

3.  Use Cases

   There are two primary use cases for this protocol.

   The primary one is to prevent on-path network devices from
   interfering with native DNS operations.  This interference includes,
   but is not limited to, spoofing DNS responses, blocking DNS requests,
   and tracking.  HTTP authentication and proxy friendliness are
   expected to make this protocol function in some environments where
   DNS directly on TLS ([RFC7858]) would not.

   A secondary use case is web applications that want to access DNS
   information.  Standardizing an HTTPS mechanism allows this to be done
   in a way consistent with the cross-origin resource sharing [CORS]
   security model of the web and also integrate the caching mechanisms




Hoffman & McManus       Expires December 8, 2017                [Page 3]


Internet-Draft           DNS Queries over HTTPS                June 2017


   of DNS with those of HTTP.  These applications may be interested in
   using a different media type than traditional clients.

   [ This paragraph is to be removed when this document is published as
   an RFC ] Note that these use cases are different than those in a
   similar protocol described at [I-D.ietf-dnsop-dns-wireformat-http].
   The use case for that protocol is proxying DNS queries over HTTP
   instead of over DNS itself.  The use cases in this document all
   involve query origination instead of proxying.

4.  Protocol Requirements

   The protocol described here bases its design on the following
   protocol requirements:

   o  The protocol must use normal HTTP semantics.

   o  The queries and responses must be able to be flexible enough to
      express every normal DNS query.

   o  The protocol must allow implementations to use HTTP's content
      negotiation mechanism.

   o  The protocol must ensure interoperable media formats through a
      mandatory to implement format wherein a query must be able to
      contain one or more EDNS extensions, including those not yet
      defined.

   o  The protocol must use a secure transport that meets the
      requirements for modern https://.

4.1.  Non-requirements

   o  Supporting network-specific DNS64 [RFC6147]

   o  Supporting other network-specific inferences from plaintext DNS
      queries

   o  Supporting insecure HTTP

   o  Supporting legacy HTTP versions

5.  The HTTP Request

   The URI scheme MUST be https.

   The path SHOULD be "/.well-known/dns-query" but a different path can
   be used if the DNS API Client has prior knowledge about a DNS API



Hoffman & McManus       Expires December 8, 2017                [Page 4]


Internet-Draft           DNS Queries over HTTPS                June 2017


   service on a different path at the origin being used.  (See Section 8
   for the registration of this in the well-known URI registry.)  Using
   the well-known path allows automated discovery of a DNS API Service,
   and also helps contextualize DNS Query requests pushed over an active
   HTTP/2 connection.

   A DNS API Client encodes the DNS query into the HTTP request using
   either the HTTP GET or POST methods.

   When using the POST method, the DNS query is included as the message
   body of the HTTP request and the Content-Type request header
   indicates the media type of the message.  POST-ed requests are
   smaller than their GET equivalents.

   When using the GET method, the URI path MUST contain a query
   parameter of the form content-type=TTT and another of the form
   body=BBBB, where "TTT" is the media type of the format used for the
   body parameter, and "BBB" is the content of the body encoded with
   base64url [RFC4648].  Using the GET method is friendlier to many HTTP
   cache implementations.

   The DNS API Client SHOULD include an HTTP "Accept:" request header to
   say what type of content can be understood in response.  The client
   MUST be prepared to process "application/dns-udpwireformat"
   {{dnswire} responses but MAY process any other type it receives.

   In order to maximize cache friendliness, DNS API clients using media
   formats that include DNS ID, such as application/dns-udpwireformat,
   should use a DNS ID of 0 in every DNS request.  HTTP semantics
   correlate the request and response, thus eliminating the need for the
   ID in a media type such as application/dns-udpwireformat.

   DNS API clients can use HTTP/2 padding and compression in the same
   way that other HTTP/2 clients use (or don't use) them.

5.1.  DNS Wire Format

   The media type is "application/dns-udpwireformat".  The body is the
   DNS on-the-wire format is defined in [