RFC 9108

YANG Types for DNS Classes and Resource Record Types

πŸ“… published September 2021, from ietf

RFC 9108 πŸ’– YANG Types for DNS Classes and Resource Record Types

Okay bestie, the title block tea β˜•: this is a Standards Track doc, so it's the real deal ✨. It was written by L. Lhotka (CZ.NIC) and P. Ε paček (Internet Systems Consortium) πŸ‘‘, it's from September 2021, and its ISSN is 2070-1721 πŸ¦‹. There's no "obsoletes" or "updates" line in the title block, so it isn't replacing or patching anything else πŸŽ€.

Abstract ✨

So this doc introduces the YANG module "iana-dns-class-rr-type" 🧚. It holds derived types that reflect two IANA registries: DNS CLASSes and Resource Record (RR) TYPEs. These types are meant to be the minimum basis for future data modeling work πŸ’….

Status of This Memo πŸ“œ

This is an Internet Standards Track document. It's a product of the Internet Engineering Task Force (IETF) 🌈, so it represents the consensus of the IETF community. It went through public review and got approved for publication by the Internet Engineering Steering Group (IESG) πŸ’œ. If you want more on Internet Standards, check Section 2 of RFC 7841 🫢.

To find the current status of this document, any errata, or how to send feedback, go to https://www.rfc-editor.org/info/rfc9108 πŸ”₯.

Copyright (c) 2021 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) as they're in effect on the date of publication πŸ“š. Please read these carefully, because they spell out your rights and restrictions for this document πŸ™ˆ. Code Components pulled out of this document must include the Simplified BSD License text, as described in Section 4.e of the Trust Legal Provisions, and they come without warranty, as described in the Simplified BSD License πŸŽ€.

Table of Contents πŸ—‚οΈ

1.  Introduction
2.  Terminology
3.  YANG Design Considerations
4.  IANA Considerations
  4.1.  URI Registrations
  4.2.  YANG Module Registrations
5.  Security Considerations
6.  References
  6.1.  Normative References
  6.2.  Informative References
Appendix A.  XSLT Stylesheet
Authors' Addresses

1. Introduction πŸ¦‹

Okay, so YANG [RFC7950] has become a de facto standard for modeling configuration and state data 🧠. It also works for specifying management operations and asynchronous notifications. It's totally reasonable to expect that this approach, using data models with standard management protocols like NETCONF [RFC6241] and RESTCONF [RFC8040], can work well for DNS operations too πŸ’–. In fact, a few efforts are already underway that try to use NETCONF or RESTCONF for configuring and managing:

  • authoritative servers,
  • resolvers, and
  • zone data.

You can use those management protocols with ad hoc or proprietary data models, but the real magic only happens if there's a (completely or partly) unified data model that multiple DNS software implementations support πŸ”₯. Then operators can, for example, run several DNS server implementations side by side and use one common configuration and management interface and data for all of them 🌸. It also gets way easier to switch to another implementation 🧚.

Looking back at the IETF Routing Area, the development of unified data models for DNS is going to be a long, complicated process 😭. It'll need real cooperation and compromise from the vendors and developers of the major DNS server platforms 🫢. Still, any DNS-related data modeling effort will probably need various DNS parameters and enumerations that live in several IANA registries πŸ‘‘. To use them with YANG, those parameters and enumerations have to be translated into matching YANG types or other structures ✨. These translations should be straightforward and mostly uncontroversial πŸ’….

So this document translates two fundamental DNS-related IANA registries into YANG πŸŽ€. It contains the initial version of the YANG module "iana-dns-class-rr-type", which defines derived types for the common parameters of DNS resource records (RR): class and type πŸ¦‹. The YANG types "dns-class" and "rr-type" reflect the IANA registries "DNS CLASSes" and "Resource Record (RR) TYPEs" [IANA-DNS-PARAMETERS] πŸ’œ.

Appendix A has an XSLT 1.0 stylesheet that IANA is meant to use to generate the initial version of the "iana-dns-class-rr-type" YANG module πŸ”§. After that, whenever a new class or RR type gets added to those registries, IANA will update the YANG module too, following the instructions in Section 4 below πŸ“.

2. Terminology πŸ“–

Here's the BCP 14 key word rule, so pay attention bestie πŸ‘€. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are interpreted as described in BCP 14 [RFC2119] [RFC8174], but only when they appear in all capitals, just like shown here πŸ’….

For describing YANG data models, check out the terminology in [RFC7950] 🧚. For DNS terms used in this document, look at [RFC1035] and [RFC8499] 🌈.

3. YANG Design Considerations 🧩

When this was written, the "Domain Name System (DNS) Parameters" [IANA-DNS-PARAMETERS] had thirteen registries in total πŸ”’. The YANG module "iana-dns-class-rr-type" only defines derived types for two of them, the ones that matter most for data models involving zone data: "DNS CLASSes" and "Resource Record (RR) TYPEs" πŸ’–. The remaining registries in [IANA-DNS-PARAMETERS], plus other DNS-related IANA registries, are expected to get reflected the same way in future YANG modules whenever needed πŸ¦‹. That way you can pick the right combo of YANG modules depending on which YANG types your data modeling job needs 🫢.

The "DNS CLASSes" and "Resource Record (RR) TYPEs" registries become YANG enumeration types called "dns-class-name" and "rr-type-name", respectively πŸŽ€. Here's the opening bit of the first one:

  typedef dns-class-name {
    type enumeration {
      enum IN {
        value 1;
        description
          "Internet (IN)";
        reference
          "RFC 1035";
      }
      ...
    }
    ...
  }

The other derived type, "rr-type-name", is defined in a similar way 🌸.

[RFC3597] introduced the option of writing a class or RR type by its assigned decimal number, instead of the mnemonic name πŸ”’. For example, the "IN" class can equally be written as "CLASS1", and the "AAAA" type can be written as "TYPE28" ✨.

So the derived types "dns-class" and "rr-type" are defined in the YANG module as a union of two member types 🧠:

  • a 16-bit decimal integer ("uint16")
  • a mnemonic name from the enumerations "dns-class-name" and "rr-type-name", respectively.

For instance, the "rr-type" type is defined like this πŸ’…:

  typedef rr-type {
    type union {
      type uint16;
      type rr-type-name;
    }
    description
      "This type allows reference to a DNS resource record type
       using either the assigned mnemonic name or numeric value.";
  }

Unassigned and reserved class and RR type values aren't in the mnemonic name enumerations, so they can only be specified by their decimal values πŸ™ˆ.

4. IANA Considerations πŸ›οΈ

This section covers the actions and processes IANA needs to take to keep the "iana-dns-class-rr-type" YANG module up to date πŸ”§. The module is meant to reflect the "DNS CLASSes" and "Resource Record (RR) TYPEs" registries in [IANA-DNS-PARAMETERS] πŸ’œ. The newest version of the YANG module lives in the "YANG Parameters" registry [IANA-YANG-PARAMETERS] πŸ¦‹.

When this document was published, IANA created and posted the first version of the "iana-dns-class-rr-type" YANG module by running the XSLT stylesheet from Appendix A on the XML version of [IANA-DNS-PARAMETERS] πŸŽ€.

IANA added this note to the "iana-dns-class-rr-type" item of the "YANG Module Names" registry [IANA-YANG-PARAMETERS] πŸ“:

Classes and types of DNS resource records must not be directly
added to the "iana-dns-class-rr-type" YANG module.  They must
instead be added to the "DNS CLASSes" and "Resource Record (RR)
TYPEs" registries, respectively.

Okay, this part is important πŸ‘‘. When a new DNS class or RR type gets added to the "DNS CLASSes" or "Resource Record (RR) TYPEs" registry, a new "enum" statement SHALL be added to the "dns-class-name" or "rr-type-name" type, respectively 🌈. The assigned name defined by the "enum" statement SHALL be the same as the mnemonic name of the new class or type ✨. The following substatements to the "enum" statement SHALL be defined πŸ’…:

"value":        Use the decimal value from the registry.

"status":       Include only if a class or type registration has been
                deprecated or obsoleted.  IANA "deprecated" maps to
                YANG status "deprecated", and IANA "obsolete" maps to
                YANG status "obsolete".

"description":  Replicate the corresponding information from the
                registry, namely the full name of the new DNS class,
                or the meaning of the new RR type, if any.

"reference":    Replicate the reference(s) from the registry.
Unassigned or reserved values SHALL NOT be included in the "dns-class-name" and "rr-type-name" enumeration types. 🚫

Every time the "iana-dns-class-rr-type" YANG module gets updated, a new "revision" statement SHALL be added before the existing "revision" statements πŸ—“οΈ.

IANA also added this note to the "DNS CLASSes" and "Resource Record (RR) TYPEs" registries πŸ“Œ:

When this registry is modified, the YANG module "iana-dns-class-
rr-type" must be updated as defined in [RFC9108].

The "Reference" text in the "DNS CLASSes" registry got updated like this πŸ¦‹:

OLD:

[RFC6895]

NEW:

[RFC6895][RFC9108]

The "Reference" text in the "Resource Record (RR) TYPEs" registry got updated like this πŸŽ€:

OLD:

[RFC6895][RFC1035]

NEW:

[RFC6895][RFC1035][RFC9108]

4.1. URI Registrations πŸ”—

This document registers a URI in the "IETF XML Registry" [RFC3688]. Here's the registration that was made πŸ’–:

URI:  urn:ietf:params:xml:ns:yang:iana-dns-class-rr-type
Registrant Contact:  The IESG.
XML:  N/A; the requested URI is an XML namespace.

4.2. YANG Module Registrations πŸ“¦

This document registers a YANG module in the "YANG Module Names" registry [RFC6020]. Here's the registration that was made 🌸:

Name:  iana-dns-class-rr-type
Namespace:  urn:ietf:params:xml:ns:yang:iana-dns-class-rr-type
Prefix:  dnsct
Reference:  RFC 9108

5. Security Considerations 🚨

Okay, serious moment πŸ™ˆ. This document translates two IANA registries into YANG data types and doesn't introduce any other technology or protocol πŸ’…. The definitions themselves have no security impact on the Internet 🫢. But their use in concrete YANG modules might have one, so please be careful 😭. The security considerations spelled out in the YANG specification [RFC7950] apply to this document as well πŸ”’.

6. References πŸ“š

The reference lists are coming up in part 2 πŸ¦‹βœ¨

6.1. Normative References πŸ’–

okay so these are the must-read refs, bestie πŸ“šβœ¨ you need them to understand the spec. here's the full list, every detail intact:

[IANA-DNS-PARAMETERS] IANA, "Domain Name System (DNS) Parameters", https://www.iana.org/assignments/dns-parameters.

[IANA-YANG-PARAMETERS] IANA, "YANG Parameters", https://www.iana.org/assignments/yang-parameters.

[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, https://www.rfc-editor.org/info/rfc2119.

[RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, DOI 10.17487/RFC3688, January 2004, https://www.rfc-editor.org/info/rfc3688.

[RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for the Network Configuration Protocol (NETCONF)", RFC 6020, DOI 10.17487/RFC6020, October 2010, https://www.rfc-editor.org/info/rfc6020.

[RFC7950] Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language", RFC 7950, DOI 10.17487/RFC7950, August 2016, https://www.rfc-editor.org/info/rfc7950.

[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017, https://www.rfc-editor.org/info/rfc8174.

[W3C.REC-xslt-19991116] Clark, J., "XSL Transformations (XSLT) Version 1.0", W3C Recommendation REC-xslt-19991116, November 1999, https://www.w3.org/TR/1999/REC-xslt-19991116.

6.2. Informative References 🌸

these ones are the nice-to-know extras 🧚 still super useful for the full picture:

[RFC1035] Mockapetris, P., "Domain names - implementation and specification", STD 13, RFC 1035, DOI 10.17487/RFC1035, November 1987, https://www.rfc-editor.org/info/rfc1035.

[RFC3597] Gustafsson, A., "Handling of Unknown DNS Resource Record (RR) Types", RFC 3597, DOI 10.17487/RFC3597, September 2003, https://www.rfc-editor.org/info/rfc3597.

[RFC6241] Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed., and A. Bierman, Ed., "Network Configuration Protocol (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011, https://www.rfc-editor.org/info/rfc6241.

[RFC8040] Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF Protocol", RFC 8040, DOI 10.17487/RFC8040, January 2017, https://www.rfc-editor.org/info/rfc8040.

[RFC8499] Hoffman, P., Sullivan, A., and K. Fujiwara, "DNS Terminology", BCP 219, RFC 8499, DOI 10.17487/RFC8499, January 2019, https://www.rfc-editor.org/info/rfc8499.

Appendix A. XSLT Stylesheet βœ¨πŸ’…

this appendix is where the magic happens πŸͺ„ it's an XSLT 1.0 stylesheet [W3C.REC-xslt-19991116] that's used to generate the first revision of the "iana-dns-class-rr-type" YANG module. you run it on the XML version of the IANA registry "Domain Name System (DNS) Parameters" [IANA-DNS-PARAMETERS] that was current when this document was published. it's giving automation πŸ€–πŸ’–

with the ubiquitous xsltproc tool, you can generate the YANG module text using this command:

    $ xsltproc iana-dns-class-rr-type.xsl dns-parameters.xml

here's the stylesheet itself, copied exactly so nothing gets lost in translation πŸŽ€:

   <CODE BEGINS> file "iana-dns-class-rr-type.xsl"
   <?xml version="1.0" standalone="yes"?>
   <stylesheet xmlns="http://www.w3.org/1999/XSL/Transform"
               xmlns:iana="http://www.iana.org/assignments"
               version="1.0">
     <output method="text"/>
     <strip-space elements="*"/>

     <variable name="dq">"</variable>
     <variable name="sq">'</variable>

     <variable name="module-intro">
       <text>module iana-dns-class-rr-type {
     yang-version 1.1;
     namespace
       "urn:ietf:params:xml:ns:yang:iana-dns-class-rr-type";
     prefix dnsct;

     organization
       "Internet Assigned Numbers Authority (IANA)";

     contact
       "        Internet Assigned Numbers Authority

        Postal: ICANN
                12025 Waterfront Drive, Suite 300
                Los Angeles, CA 90094

        Tel:    +1 424 254 5300

        &lt;mailto:iana@iana.org&gt;";

     description
       "This YANG module translates IANA registries 'DNS CLASSes' and
        'Resource Record (RR) TYPEs' to YANG-derived types.

        Copyright (c) 2021 IETF Trust and the persons identified as
        authors of the code.  All rights reserved.

        Redistribution and use in source and binary forms, with or
        without modification, is permitted pursuant to, and subject to
        the license terms contained in, the Simplified BSD License set
        forth in Section 4.c of the IETF Trust's Legal Provisions
        Relating to IETF Documents
        (https://trustee.ietf.org/license-info).

        This version of this YANG module was generated from
        the corresponding IANA registries using an XSLT stylesheet
        from Appendix A of RFC 9108
        (https://www.rfc-editor.org/info/rfc9108); see the RFC itself
        for full legal notices.";

     reference
       "IANA 'Domain Name System (DNS) Parameters' registry
        https://www.iana.org/assignments/dns-parameters";</text>
        <text>&#xA;&#xA;</text>
     </variable>

     <template name="enum">
       <param name="id"/>
       <value-of select="concat('      enum ', $id)"/>
       <text> {&#xA;        value </text>
       <value-of select="concat(iana:value, ';&#xA;')"/>
       <if test="contains(iana:description, 'OBSOLETE')">
         <text>        status obsolete;&#xA;</text>
       </if>
       <apply-templates select="iana:description"/>
       <variable name="xrefs" select="iana:xref[@type!='note']"/>
       <if test="$xrefs">
         <text>        reference&#xA;          "</text>
         <if test="count($xrefs)&gt;1">- </if>
         <apply-templates select="iana:xref[@type!='note']"/>
       </if>
       <text>      }&#xA;</text>
     </template>

     <template match="/">
       <value-of select="$module-intro"/>
       <apply-templates select="iana:registry[@id='dns-parameters']"/>
       <text>}&#xA;</text>
     </template>

     <template match="iana:registry[@id='dns-parameters']">
       <apply-templates select="iana:updated"/>
       <apply-templates
           select="iana:registry[@id='dns-parameters-2']"/>
       <apply-templates
           select="iana:registry[@id='dns-parameters-4']"/>
     </template>

     <template match="iana:updated">
       <value-of select="concat('  revision ', ., ' {')"/>
       <text>
       description
         "Initial revision.";
       reference
         "RFC 9108: YANG Types for DNS Classes and Resource Record
          Types";
     }

     /* Typedefs */&#xA;&#xA;</text>
     </template>

     <template match="iana:registry[@id='dns-parameters-2']">
       <text>  typedef dns-class-name {&#xA;</text>
       <text>    type enumeration {&#xA;</text>
       <apply-templates
           select="iana:record[not(iana:description='Unassigned' or
                   starts-with(iana:description,'Reserved'))]"
           mode="class"/>
       <text>    }
       description
         "This enumeration type defines mnemonic names and corresponding
          numeric values of DNS classes.";
       reference
         "RFC 6895: Domain Name System (DNS) IANA Considerations";
     }

     typedef dns-class {
       type union {
         type uint16;
         type dns-class-name;
       }
       description
         "This type allows reference to a DNS class using either the
          assigned mnemonic name or numeric value.";
     }&#xA;&#xA;</text>
     </template>

     <template match="iana:registry[@id='dns-parameters-4']">
       <text>  typedef rr-type-name {&#xA;</text>
       <text>    type enumeration {&#xA;</text>
       <apply-templates
           select="iana:record[iana:type!='Unassigned' and
                   iana:type!='Private use' and iana:type!='Reserved']"
           mode="rr-type"/>
       <text>    }
       description
         "This enumeration type defines mnemonic names and corresponding
          numeric values of DNS resource record types.";
       reference
         "- RFC 6895: Domain Name System (DNS) IANA Considerations

          - RFC 1035: Domain names - implementation and specification";
     }

     typedef rr-type {
       type union {
         type uint16;
         type rr-type-name;
       }
       description
         "This type allows reference to a DNS resource record type
          using either the assigned mnemonic name or numeric value.";
     }&#xA;</text>
     </template>

     <template match="iana:record" mode="class">
       <call-template name="enum">
         <with-param name="id">
           <choose>
             <when test="contains(iana:description,'(')">
               <value-of select="substring-before(substring-after(
                                 iana:description, '('), ')')"/>
             </when>
             <otherwise>
               <value-of
                   select="substring-after(iana:description, ' ')"/>
             </otherwise>
           </choose>
         </with-param>
       </call-template>
     </template>

     <template match="iana:record" mode="rr-type">
       <call-template name="enum">
         <with-param name="id" select="iana:type"/>
       </call-template>
     </template>

     <template match="iana:description">
       <text>        description&#xA;          </text>
       <value-of select="concat($dq, ., $dq, ';&#xA;')"/>
     </template>

     <template match="iana:xref">
       <choose>
         <when test="@type='rfc'">
           <value-of
               select="concat('RFC ', substring-after(@data, 'rfc'))"/>
         </when>
         <when test="@type='person'">
           <apply-templates
               select="/iana:registry/iana:people/iana:person[
                       @id=current()/@data]"/>
         </when>
         <when test="@type='text'">
           <value-of select="translate(., $dq, $sq)"/>
         </when>
         <otherwise>
           <value-of select="@data"/>
         </otherwise>
       </choose>
       <choose>
         <when test="position()=last()">
           <text>";&#xA;</text>
         </when>
         <otherwise>
           <text>&#xA;           - </text>
         </otherwise>
       </choose>
     </template>

     <template match="iana:person">
       <value-of select="concat(iana:name, ' &lt;', iana:uri, '&gt;')"/>
     </template>

   </stylesheet>
   <CODE ENDS>

Authors' Addresses 🫢

meet the brains behind it, the people who made all of this happen πŸ‘‘

Ladislav Lhotka CZ.NIC Czech Republic

Email: ladislav.lhotka@nic.cz

Petr Špaček Internet Systems Consortium Czech Republic

Email: pspacek@isc.org

that's a wrap on RFC 9108, bestie!! πŸŒˆπŸ’–βœ¨

πŸ“¦ where this page comes from