Representing DNS Messages in JSON
RFC 8427

Document Type RFC - Informational (July 2018; Errata)
Was draft-hoffman-dns-in-json (individual in art area)
Last updated 2018-07-24
Stream IETF
Formats plain text pdf html bibtex
Reviews
Stream WG state Submitted to IESG for Publication
Document shepherd Matthew Miller
Shepherd write-up Show (last changed 2018-03-13)
IESG IESG state RFC 8427 (Informational)
Consensus Boilerplate Yes
Telechat date
Responsible AD Alexey Melnikov
Send notices to Matthew Miller <linuxwolf+ietf@outer-planes.net>
IANA IANA review state IANA OK - Actions Needed
IANA action state RFC-Ed-Ack
Internet Engineering Task Force (IETF)                        P. Hoffman
Request for Comments: 8427                                         ICANN
Category: Informational                                        July 2018
ISSN: 2070-1721

                   Representing DNS Messages in JSON

Abstract

   Some applications use DNS messages, or parts of DNS messages, as
   data.  For example, a system that captures DNS queries and responses
   might want to be able to easily search them without having to decode
   the messages each time.  Another example is a system that puts
   together DNS queries and responses from message parts.  This document
   describes a general format for DNS message data in JSON.  Specific
   profiles of the format in this document can be described in other
   documents for specific applications and usage scenarios.

Status of This Memo

   This document is not an Internet Standards Track specification; it is
   published for informational purposes.

   This document is a product of the Internet Engineering Task Force
   (IETF).  It represents the consensus of the IETF community.  It has
   received public review and has been approved for publication by the
   Internet Engineering Steering Group (IESG).  Not all documents
   approved by the IESG are candidates for any level of Internet
   Standard; see Section 2 of RFC 7841.

   Information about the current status of this document, any errata,
   and how to provide feedback on it may be obtained at
   https://www.rfc-editor.org/info/rfc8427.

Hoffman                       Informational                     [Page 1]
RFC 8427                       DNS in JSON                     July 2018

Copyright Notice

   Copyright (c) 2018 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
   (https://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  . . . . . . . . . . . . . . . . . . . . . . . .   3
     1.1.  Design of the Format  . . . . . . . . . . . . . . . . . .   3
     1.2.  Terminology . . . . . . . . . . . . . . . . . . . . . . .   5
   2.  JSON Format for DNS Messages  . . . . . . . . . . . . . . . .   5
     2.1.  Message Object Members  . . . . . . . . . . . . . . . . .   5
     2.2.  Resource Record Object Members  . . . . . . . . . . . . .   6
     2.3.  Specific RDATA Field Members  . . . . . . . . . . . . . .   7
     2.4.  The Message and Its Parts as Octets . . . . . . . . . . .   8
     2.5.  Additional Message Object Members . . . . . . . . . . . .   8
     2.6.  Name Fields . . . . . . . . . . . . . . . . . . . . . . .   9
   3.  JSON Format for a Paired DNS Query and Response . . . . . . .   9
   4.  Streaming DNS Objects . . . . . . . . . . . . . . . . . . . .   9
   5.  Examples  . . . . . . . . . . . . . . . . . . . . . . . . . .  10
     5.1.  Example of the Format of a DNS Query  . . . . . . . . . .  10
     5.2.  Example of the Format of a Paired DNS Query and Response   11
   6.  Local Format Policy . . . . . . . . . . . . . . . . . . . . .  12
   7.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .  12
     7.1.  Media Type Registration of application/dns+json . . . . .  12
   8.  Security Considerations . . . . . . . . . . . . . . . . . . .  13
   9.  Privacy Considerations  . . . . . . . . . . . . . . . . . . .  14
   10. References  . . . . . . . . . . . . . . . . . . . . . . . . .  14
     10.1.  Normative References . . . . . . . . . . . . . . . . . .  14
     10.2.  Informative References . . . . . . . . . . . . . . . . .  15
   Acknowledgements  . . . . . . . . . . . . . . . . . . . . . . . .  15
   Author's Address  . . . . . . . . . . . . . . . . . . . . . . . .  15

Hoffman                       Informational                     [Page 2]
RFC 8427                       DNS in JSON                     July 2018

1.  Introduction

   The DNS message format is defined in [RFC1035].  DNS queries and DNS
   responses have exactly the same structure.  Many of the field names
   and data type names given in [RFC1035] are commonly used in
   discussions of DNS.  For example, it is common to hear things like
   "the query had a QNAME of 'example.com'" or "the RDATA has a simple
   structure".

   There are hundreds of data-interchange formats for serializing
   structured data.  Currently, JSON [RFC8259] is quite popular for many
   types of data, particularly data that has named subfields and
   optional parts.
Show full document text