1 Internet Engineering Task Force (IETF) L. Lhotka
2 Request for Comments: 9108 CZ.NIC
3 Category: Standards Track P. Špaček
4 ISSN: 2070-1721 Internet Systems Consortium
5 September 2021
6
7
8 YANG Types for DNS Classes and Resource Record Types
9
10 Abstract
11
12 This document introduces the YANG module "iana-dns-class-rr-type",
13 which contains derived types reflecting two IANA registries: DNS
14 CLASSes and Resource Record (RR) TYPEs. These YANG types are
15 intended as the minimum basis for future data modeling work.
16
17 Status of This Memo
18
19 This is an Internet Standards Track document.
20
21 This document is a product of the Internet Engineering Task Force
22 (IETF). It represents the consensus of the IETF community. It has
23 received public review and has been approved for publication by the
24 Internet Engineering Steering Group (IESG). Further information on
25 Internet Standards is available in Section 2 of RFC 7841.
26
27 Information about the current status of this document, any errata,
28 and how to provide feedback on it may be obtained at
29 https://www.rfc-editor.org/info/rfc9108.
30
31 Copyright Notice
32
33 Copyright (c) 2021 IETF Trust and the persons identified as the
34 document authors. All rights reserved.
35
36 This document is subject to BCP 78 and the IETF Trust's Legal
37 Provisions Relating to IETF Documents
38 (https://trustee.ietf.org/license-info) in effect on the date of
39 publication of this document. Please review these documents
40 carefully, as they describe your rights and restrictions with respect
41 to this document. Code Components extracted from this document must
42 include Simplified BSD License text as described in Section 4.e of
43 the Trust Legal Provisions and are provided without warranty as
44 described in the Simplified BSD License.
45
46 Table of Contents
47
48 1. Introduction
49 2. Terminology
50 3. YANG Design Considerations
51 4. IANA Considerations
52 4.1. URI Registrations
53 4.2. YANG Module Registrations
54 5. Security Considerations
55 6. References
56 6.1. Normative References
57 6.2. Informative References
58 Appendix A. XSLT Stylesheet
59 Authors' Addresses
60
61 1. Introduction
62
63 YANG [RFC7950] has become a de facto standard as a language for
64 modeling configuration and state data, as well as specifying
65 management operations and asynchronous notifications. It is
66 reasonable to expect that the approach based on utilizing such data
67 models along with standard management protocols such as
68 NETCONF [RFC6241] and RESTCONF [RFC8040] can be effectively used in
69 DNS operations, too. In fact, several efforts are currently underway
70 that attempt to use NETCONF or RESTCONF for configuring and managing
71
72 * authoritative servers,
73
74 * resolvers, and
75
76 * zone data.
77
78 While it is possible to use the management protocols mentioned above
79 with ad hoc or proprietary data models, their real potential can be
80 realized only if there is a (completely or partly) unified data model
81 supported by multiple DNS software implementations. Operators can
82 then, for instance, run several DNS server implementations in
83 parallel, and use a common configuration and management interface and
84 data for all of them. Also, it becomes considerably easier to
85 migrate to another implementation.
86
87 Based on the previous experience from the IETF Routing Area, it is to
88 be expected that the development of unified data models for DNS will
89 be a lengthy and complicated process that will require active
90 cooperation and compromise from the vendors and developers of major
91 DNS server platforms. Nevertheless, it is likely that any DNS-
92 related data modeling effort will need to use various DNS parameters
93 and enumerations that are specified in several IANA registries. For
94 use with YANG, these parameters and enumerations have to be
95 translated into corresponding YANG types or other structures. Such
96 translations should be straightforward and relatively
97 uncontroversial.
98
99 This document provides a translation of two fundamental DNS-related
100 IANA registries to YANG. It contains the initial version of the YANG
101 module "iana-dns-class-rr-type", which defines derived types for the
102 common parameters of DNS resource records (RR): class and type.
103 These YANG types, "dns-class" and "rr-type", reflect the IANA
104 registries "DNS CLASSes" and "Resource Record (RR) TYPEs"
105 [IANA-DNS-PARAMETERS].
106
107 Appendix A contains an XSLT 1.0 stylesheet that is intended to be
108 used by IANA for generating the initial version of the "iana-dns-
109 class-rr-type" YANG module. Subsequently, whenever a new class or RR
110 type is added to the above registries, IANA will also update the
111 "iana-dns-class-rr-type" YANG module, following the instructions in
112 Section 4 below.
113
114 2. Terminology
115
116 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
117 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
118 "OPTIONAL" in this document are to be interpreted as described in
119 BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all
120 capitals, as shown here.
121
122 The terminology for describing YANG data models can be found in
123 [RFC7950]. DNS terminology used in this document can be found in
124 [RFC1035] and [RFC8499].
125
126 3. YANG Design Considerations
127
128 At the time of writing, the "Domain Name System (DNS) Parameters"
129 [IANA-DNS-PARAMETERS] contains altogether thirteen registries. The
130 YANG module "iana-dns-class-rr-type" defines derived types
131 corresponding to only two of the registries that are essential for
132 data models involving zone data, namely "DNS CLASSes" and "Resource
133 Record (RR) TYPEs". It is expected that the remaining registries in
134 [IANA-DNS-PARAMETERS], as well as other DNS-related IANA registries,
135 will be analogously reflected in future YANG modules as necessary.
136 This way, an appropriate combination of YANG modules can be chosen
137 depending on which YANG types are needed for a given data modeling
138 purpose.
139
140 The registries "DNS CLASSes" and "Resource Record (RR) TYPEs" are
141 transformed into YANG enumeration types "dns-class-name" and "rr-
142 type-name", respectively. This is the initial fragment of the
143 former:
144
145 typedef dns-class-name {
146 type enumeration {
147 enum IN {
148 value 1;
149 description
150 "Internet (IN)";
151 reference
152 "RFC 1035";
153 }
154 ...
155 }
156 ...
157 }
158
159 The other derived type, "rr-type-name", is defined similarly.
160
161 [RFC3597] introduced the option of specifying a class or RR type via
162 its assigned decimal number as an alternative to the mnemonic name.
163 For example, the "IN" class can be equivalently written as "CLASS1",
164 and "AAAA" type can be written as "TYPE28".
165
166 Accordingly, the derived types "dns-class" and "rr-type" are defined
167 in the YANG module as a union of two member types:
168
169 * 16-bit decimal integer ("uint16")
170
171 * mnemonic name belonging to the enumerations "dns-class-name" and
172 "rr-type-name", respectively.
173
174 For instance, the "rr-type" type is defined as follows:
175
176 typedef rr-type {
177 type union {
178 type uint16;
179 type rr-type-name;
180 }
181 description
182 "This type allows reference to a DNS resource record type
183 using either the assigned mnemonic name or numeric value.";
184 }
185
186 As unassigned and reserved class and RR type values are not included
187 in the mnemonic name enumerations, they can only be specified using
188 their decimal values.
189
190 4. IANA Considerations
191
192 This section deals with actions and processes necessary for IANA to
193 undertake to maintain the "iana-dns-class-rr-type" YANG module. This
194 YANG module is intended to reflect the "DNS CLASSes" and "Resource
195 Record (RR) TYPEs" registries in [IANA-DNS-PARAMETERS]. The most
196 recent version of the YANG module is available from the "YANG
197 Parameters" registry [IANA-YANG-PARAMETERS].
198
199 With the publication of this document, IANA has created and posted
200 the initial version of the "iana-dns-class-rr-type" YANG module by
201 applying the XSLT stylesheet from Appendix A to the XML version of
202 [IANA-DNS-PARAMETERS].
203
204 IANA has added this note to the "iana-dns-class-rr-type" item of the
205 "YANG Module Names" registry [IANA-YANG-PARAMETERS]:
206
207 | Classes and types of DNS resource records must not be directly
208 | added to the "iana-dns-class-rr-type" YANG module. They must
209 | instead be added to the "DNS CLASSes" and "Resource Record (RR)
210 | TYPEs" registries, respectively.
211
212 When a new DNS class or RR type is added to the "DNS CLASSes" or
213 "Resource Record (RR) TYPEs" registry, a new "enum" statement SHALL
214 be added to the "dns-class-name" or "rr-type-name" type,
215 respectively. The assigned name defined by the "enum" statement
216 SHALL be the same as the mnemonic name of the new class or type. The
217 following substatements to the "enum" statement SHALL be defined:
218
219 "value": Use the decimal value from the registry.
220
221 "status": Include only if a class or type registration has been
222 deprecated or obsoleted. IANA "deprecated" maps to
223 YANG status "deprecated", and IANA "obsolete" maps to
224 YANG status "obsolete".
225
226 "description": Replicate the corresponding information from the
227 registry, namely the full name of the new DNS class,
228 or the meaning of the new RR type, if any.
229
230 "reference": Replicate the reference(s) from the registry.
231
232 Unassigned or reserved values SHALL NOT be included in the "dns-
233 class-name" and "rr-type-name" enumeration types.
234
235 Each time the "iana-dns-class-rr-type" YANG module is updated, a new
236 "revision" statement SHALL be added before the existing "revision"
237 statements.
238
239 IANA has added this note to the "DNS CLASSes" and "Resource Record
240 (RR) TYPEs" registries:
241
242 | When this registry is modified, the YANG module "iana-dns-class-
243 | rr-type" must be updated as defined in [RFC9108].
244
245 The "Reference" text in the "DNS CLASSes" registry has been updated
246 as follows:
247
248 OLD:
249
250 | [RFC6895]
251
252 NEW:
253
254 | [RFC6895][RFC9108]
255
256 The "Reference" text in the "Resource Record (RR) TYPEs" registry has
257 been updated as follows:
258
259 OLD:
260
261 | [RFC6895][RFC1035]
262
263 NEW:
264
265 | [RFC6895][RFC1035][RFC9108]
266
267 4.1. URI Registrations
268
269 This document registers a URI in the "IETF XML Registry" [RFC3688].
270 The following registration has been made:
271
272 URI: urn:ietf:params:xml:ns:yang:iana-dns-class-rr-type
273 Registrant Contact: The IESG.
274 XML: N/A; the requested URI is an XML namespace.
275
276 4.2. YANG Module Registrations
277
278 This document registers a YANG module in the "YANG Module Names"
279 registry [RFC6020]. The following registration has been made:
280
281 Name: iana-dns-class-rr-type
282 Namespace: urn:ietf:params:xml:ns:yang:iana-dns-class-rr-type
283 Prefix: dnsct
284 Reference: RFC 9108
285
286 5. Security Considerations
287
288 This document translates two IANA registries into YANG data types and
289 otherwise introduces no technology or protocol. The definitions
290 themselves have no security impact on the Internet, but their use in
291 concrete YANG modules might have. The security considerations
292 spelled out in the YANG specification [RFC7950] apply to this
293 document as well.
294
295 6. References
296
297 6.1. Normative References
298
299 [IANA-DNS-PARAMETERS]
300 IANA, "Domain Name System (DNS) Parameters",
301 <https://www.iana.org/assignments/dns-parameters>.
302
303 [IANA-YANG-PARAMETERS]
304 IANA, "YANG Parameters",
305 <https://www.iana.org/assignments/yang-parameters>.
306
307 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
308 Requirement Levels", BCP 14, RFC 2119,
309 DOI 10.17487/RFC2119, March 1997,
310 <https://www.rfc-editor.org/info/rfc2119>.
311
312 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688,
313 DOI 10.17487/RFC3688, January 2004,
314 <https://www.rfc-editor.org/info/rfc3688>.
315
316 [RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for
317 the Network Configuration Protocol (NETCONF)", RFC 6020,
318 DOI 10.17487/RFC6020, October 2010,
319 <https://www.rfc-editor.org/info/rfc6020>.
320
321 [RFC7950] Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language",
322 RFC 7950, DOI 10.17487/RFC7950, August 2016,
323 <https://www.rfc-editor.org/info/rfc7950>.
324
325 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
326 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
327 May 2017, <https://www.rfc-editor.org/info/rfc8174>.
328
329 [W3C.REC-xslt-19991116]
330 Clark, J., "XSL Transformations (XSLT) Version 1.0", W3C
331 Recommendation REC-xslt-19991116, November 1999,
332 <https://www.w3.org/TR/1999/REC-xslt-19991116>.
333
334 6.2. Informative References
335
336 [RFC1035] Mockapetris, P., "Domain names - implementation and
337 specification", STD 13, RFC 1035, DOI 10.17487/RFC1035,
338 November 1987, <https://www.rfc-editor.org/info/rfc1035>.
339
340 [RFC3597] Gustafsson, A., "Handling of Unknown DNS Resource Record
341 (RR) Types", RFC 3597, DOI 10.17487/RFC3597, September
342 2003, <https://www.rfc-editor.org/info/rfc3597>.
343
344 [RFC6241] Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed.,
345 and A. Bierman, Ed., "Network Configuration Protocol
346 (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011,
347 <https://www.rfc-editor.org/info/rfc6241>.
348
349 [RFC8040] Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF
350 Protocol", RFC 8040, DOI 10.17487/RFC8040, January 2017,
351 <https://www.rfc-editor.org/info/rfc8040>.
352
353 [RFC8499] Hoffman, P., Sullivan, A., and K. Fujiwara, "DNS
354 Terminology", BCP 219, RFC 8499, DOI 10.17487/RFC8499,
355 January 2019, <https://www.rfc-editor.org/info/rfc8499>.
356
357 Appendix A. XSLT Stylesheet
358
359 This appendix contains an XSLT 1.0 stylesheet [W3C.REC-xslt-19991116]
360 that is to be used to generate the initial revision of the "iana-dns-
361 class-rr-type" YANG module. This is achieved by applying the
362 stylesheet to the XML version of the IANA registry "Domain Name
363 System (DNS) Parameters" [IANA-DNS-PARAMETERS] that was current at
364 the time this document was published.
365
366 Using the ubiquitous xsltproc tool, the YANG module text can be
367 generated with this command:
368
369 $ xsltproc iana-dns-class-rr-type.xsl dns-parameters.xml
370
371 <CODE BEGINS> file "iana-dns-class-rr-type.xsl"
372 <?xml version="1.0" standalone="yes"?>
373 <stylesheet xmlns="http://www.w3.org/1999/XSL/Transform"
374 xmlns:iana="http://www.iana.org/assignments"
375 version="1.0">
376 <output method="text"/>
377 <strip-space elements="*"/>
378
379 <variable name="dq">"</variable>
380 <variable name="sq">'</variable>
381
382 <variable name="module-intro">
383 <text>module iana-dns-class-rr-type {
384 yang-version 1.1;
385 namespace
386 "urn:ietf:params:xml:ns:yang:iana-dns-class-rr-type";
387 prefix dnsct;
388
389 organization
390 "Internet Assigned Numbers Authority (IANA)";
391
392 contact
393 " Internet Assigned Numbers Authority
394
395 Postal: ICANN
396 12025 Waterfront Drive, Suite 300
397 Los Angeles, CA 90094
398
399 Tel: +1 424 254 5300
400
401 <mailto:iana@iana.org>";
402
403 description
404 "This YANG module translates IANA registries 'DNS CLASSes' and
405 'Resource Record (RR) TYPEs' to YANG-derived types.
406
407 Copyright (c) 2021 IETF Trust and the persons identified as
408 authors of the code. All rights reserved.
409
410 Redistribution and use in source and binary forms, with or
411 without modification, is permitted pursuant to, and subject to
412 the license terms contained in, the Simplified BSD License set
413 forth in Section 4.c of the IETF Trust's Legal Provisions
414 Relating to IETF Documents
415 (https://trustee.ietf.org/license-info).
416
417 This version of this YANG module was generated from
418 the corresponding IANA registries using an XSLT stylesheet
419 from Appendix A of RFC 9108
420 (https://www.rfc-editor.org/info/rfc9108); see the RFC itself
421 for full legal notices.";
422
423 reference
424 "IANA 'Domain Name System (DNS) Parameters' registry
425 https://www.iana.org/assignments/dns-parameters";</text>
426 <text>

</text>
427 </variable>
428
429 <template name="enum">
430 <param name="id"/>
431 <value-of select="concat(' enum ', $id)"/>
432 <text> {
 value </text>
433 <value-of select="concat(iana:value, ';
')"/>
434 <if test="contains(iana:description, 'OBSOLETE')">
435 <text> status obsolete;
</text>
436 </if>
437 <apply-templates select="iana:description"/>
438 <variable name="xrefs" select="iana:xref[@type!='note']"/>
439 <if test="$xrefs">
440 <text> reference
 "</text>
441 <if test="count($xrefs)>1">- </if>
442 <apply-templates select="iana:xref[@type!='note']"/>
443 </if>
444 <text> }
</text>
445 </template>
446
447 <template match="/">
448 <value-of select="$module-intro"/>
449 <apply-templates select="iana:registry[@id='dns-parameters']"/>
450 <text>}
</text>
451 </template>
452
453 <template match="iana:registry[@id='dns-parameters']">
454 <apply-templates select="iana:updated"/>
455 <apply-templates
456 select="iana:registry[@id='dns-parameters-2']"/>
457 <apply-templates
458 select="iana:registry[@id='dns-parameters-4']"/>
459 </template>
460
461 <template match="iana:updated">
462 <value-of select="concat(' revision ', ., ' {')"/>
463 <text>
464 description
465 "Initial revision.";
466 reference
467 "RFC 9108: YANG Types for DNS Classes and Resource Record
468 Types";
469 }
470
471 /* Typedefs */

</text>
472 </template>
473
474 <template match="iana:registry[@id='dns-parameters-2']">
475 <text> typedef dns-class-name {
</text>
476 <text> type enumeration {
</text>
477 <apply-templates
478 select="iana:record[not(iana:description='Unassigned' or
479 starts-with(iana:description,'Reserved'))]"
480 mode="class"/>
481 <text> }
482 description
483 "This enumeration type defines mnemonic names and corresponding
484 numeric values of DNS classes.";
485 reference
486 "RFC 6895: Domain Name System (DNS) IANA Considerations";
487 }
488
489 typedef dns-class {
490 type union {
491 type uint16;
492 type dns-class-name;
493 }
494 description
495 "This type allows reference to a DNS class using either the
496 assigned mnemonic name or numeric value.";
497 }

</text>
498 </template>
499
500 <template match="iana:registry[@id='dns-parameters-4']">
501 <text> typedef rr-type-name {
</text>
502 <text> type enumeration {
</text>
503 <apply-templates
504 select="iana:record[iana:type!='Unassigned' and
505 iana:type!='Private use' and iana:type!='Reserved']"
506 mode="rr-type"/>
507 <text> }
508 description
509 "This enumeration type defines mnemonic names and corresponding
510 numeric values of DNS resource record types.";
511 reference
512 "- RFC 6895: Domain Name System (DNS) IANA Considerations
513
514 - RFC 1035: Domain names - implementation and specification";
515 }
516
517 typedef rr-type {
518 type union {
519 type uint16;
520 type rr-type-name;
521 }
522 description
523 "This type allows reference to a DNS resource record type
524 using either the assigned mnemonic name or numeric value.";
525 }
</text>
526 </template>
527
528 <template match="iana:record" mode="class">
529 <call-template name="enum">
530 <with-param name="id">
531 <choose>
532 <when test="contains(iana:description,'(')">
533 <value-of select="substring-before(substring-after(
534 iana:description, '('), ')')"/>
535 </when>
536 <otherwise>
537 <value-of
538 select="substring-after(iana:description, ' ')"/>
539 </otherwise>
540 </choose>
541 </with-param>
542 </call-template>
543 </template>
544
545 <template match="iana:record" mode="rr-type">
546 <call-template name="enum">
547 <with-param name="id" select="iana:type"/>
548 </call-template>
549 </template>
550
551 <template match="iana:description">
552 <text> description
 </text>
553 <value-of select="concat($dq, ., $dq, ';
')"/>
554 </template>
555
556 <template match="iana:xref">
557 <choose>
558 <when test="@type='rfc'">
559 <value-of
560 select="concat('RFC ', substring-after(@data, 'rfc'))"/>
561 </when>
562 <when test="@type='person'">
563 <apply-templates
564 select="/iana:registry/iana:people/iana:person[
565 @id=current()/@data]"/>
566 </when>
567 <when test="@type='text'">
568 <value-of select="translate(., $dq, $sq)"/>
569 </when>
570 <otherwise>
571 <value-of select="@data"/>
572 </otherwise>
573 </choose>
574 <choose>
575 <when test="position()=last()">
576 <text>";
</text>
577 </when>
578 <otherwise>
579 <text>
 - </text>
580 </otherwise>
581 </choose>
582 </template>
583
584 <template match="iana:person">
585 <value-of select="concat(iana:name, ' <', iana:uri, '>')"/>
586 </template>
587
588 </stylesheet>
589 <CODE ENDS>
590
591 Authors' Addresses
592
593 Ladislav Lhotka
594 CZ.NIC
595 Czech Republic
596
597 Email: ladislav.lhotka@nic.cz
598
599
600 Petr Špaček
601 Internet Systems Consortium
602 Czech Republic
603
604 Email: pspacek@isc.org
605
The IETF is responsible for the creation and maintenance of the DNS RFCs. The ICANN DNS RFC annotation project provides a forum for collecting community annotations on these RFCs as an aid to understanding for implementers and any interested parties. The annotations displayed here are not the result of the IETF consensus process.
This RFC is included in the DNS RFCs annotation project whose home page is here.