1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
|
Internet Engineering Task Force (IETF) L. Lhotka
Request for Comments: 9108 CZ.NIC
Category: Standards Track P. Špaček
ISSN: 2070-1721 Internet Systems Consortium
September 2021
YANG Types for DNS Classes and Resource Record Types
Abstract
This document introduces the YANG module "iana-dns-class-rr-type",
which contains derived types reflecting two IANA registries: DNS
CLASSes and Resource Record (RR) TYPEs. These YANG types are
intended as the minimum basis for future data modeling work.
Status of This Memo
This is an Internet Standards Track document.
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). Further information on
Internet Standards is available in 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/rfc9108.
Copyright Notice
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) 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. 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
YANG [RFC7950] has become a de facto standard as a language for
modeling configuration and state data, as well as specifying
management operations and asynchronous notifications. It is
reasonable to expect that the approach based on utilizing such data
models along with standard management protocols such as
NETCONF [RFC6241] and RESTCONF [RFC8040] can be effectively used in
DNS operations, too. In fact, several efforts are currently underway
that attempt to use NETCONF or RESTCONF for configuring and managing
* authoritative servers,
* resolvers, and
* zone data.
While it is possible to use the management protocols mentioned above
with ad hoc or proprietary data models, their real potential can be
realized only if there is a (completely or partly) unified data model
supported by multiple DNS software implementations. Operators can
then, for instance, run several DNS server implementations in
parallel, and use a common configuration and management interface and
data for all of them. Also, it becomes considerably easier to
migrate to another implementation.
Based on the previous experience from the IETF Routing Area, it is to
be expected that the development of unified data models for DNS will
be a lengthy and complicated process that will require active
cooperation and compromise from the vendors and developers of major
DNS server platforms. Nevertheless, it is likely that any DNS-
related data modeling effort will need to use various DNS parameters
and enumerations that are specified in several IANA registries. For
use with YANG, these parameters and enumerations have to be
translated into corresponding YANG types or other structures. Such
translations should be straightforward and relatively
uncontroversial.
This document provides a translation of two fundamental DNS-related
IANA registries to 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.
These YANG types, "dns-class" and "rr-type", reflect the IANA
registries "DNS CLASSes" and "Resource Record (RR) TYPEs"
[IANA-DNS-PARAMETERS].
Appendix A contains an XSLT 1.0 stylesheet that is intended to be
used by IANA for generating the initial version of the "iana-dns-
class-rr-type" YANG module. Subsequently, whenever a new class or RR
type is added to the above registries, IANA will also update the
"iana-dns-class-rr-type" YANG module, following the instructions in
Section 4 below.
2. Terminology
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in
BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all
capitals, as shown here.
The terminology for describing YANG data models can be found in
[RFC7950]. DNS terminology used in this document can be found in
[RFC1035] and [RFC8499].
3. YANG Design Considerations
At the time of writing, the "Domain Name System (DNS) Parameters"
[IANA-DNS-PARAMETERS] contains altogether thirteen registries. The
YANG module "iana-dns-class-rr-type" defines derived types
corresponding to only two of the registries that are essential for
data models involving zone data, namely "DNS CLASSes" and "Resource
Record (RR) TYPEs". It is expected that the remaining registries in
[IANA-DNS-PARAMETERS], as well as other DNS-related IANA registries,
will be analogously reflected in future YANG modules as necessary.
This way, an appropriate combination of YANG modules can be chosen
depending on which YANG types are needed for a given data modeling
purpose.
The registries "DNS CLASSes" and "Resource Record (RR) TYPEs" are
transformed into YANG enumeration types "dns-class-name" and "rr-
type-name", respectively. This is the initial fragment of the
former:
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 similarly.
[RFC3597] introduced the option of specifying a class or RR type via
its assigned decimal number as an alternative to the mnemonic name.
For example, the "IN" class can be equivalently written as "CLASS1",
and "AAAA" type can be written as "TYPE28".
Accordingly, the derived types "dns-class" and "rr-type" are defined
in the YANG module as a union of two member types:
* 16-bit decimal integer ("uint16")
* mnemonic name belonging to the enumerations "dns-class-name" and
"rr-type-name", respectively.
For instance, the "rr-type" type is defined as follows:
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.";
}
As unassigned and reserved class and RR type values are not included
in the mnemonic name enumerations, they can only be specified using
their decimal values.
4. IANA Considerations
This section deals with actions and processes necessary for IANA to
undertake to maintain the "iana-dns-class-rr-type" YANG module. This
YANG module is intended to reflect the "DNS CLASSes" and "Resource
Record (RR) TYPEs" registries in [IANA-DNS-PARAMETERS]. The most
recent version of the YANG module is available from the "YANG
Parameters" registry [IANA-YANG-PARAMETERS].
With the publication of this document, IANA has created and posted
the initial version of the "iana-dns-class-rr-type" YANG module by
applying the XSLT stylesheet from Appendix A to the XML version of
[IANA-DNS-PARAMETERS].
IANA has 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.
When a new DNS class or RR type is 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.
Each time the "iana-dns-class-rr-type" YANG module is updated, a new
"revision" statement SHALL be added before the existing "revision"
statements.
IANA has 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 has been updated
as follows:
OLD:
| [RFC6895]
NEW:
| [RFC6895][RFC9108]
The "Reference" text in the "Resource Record (RR) TYPEs" registry has
been updated as follows:
OLD:
| [RFC6895][RFC1035]
NEW:
| [RFC6895][RFC1035][RFC9108]
4.1. URI Registrations
This document registers a URI in the "IETF XML Registry" [RFC3688].
The following registration has been 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]. The following registration has been 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
This document translates two IANA registries into YANG data types and
otherwise introduces no technology or protocol. The definitions
themselves have no security impact on the Internet, but their use in
concrete YANG modules might have. The security considerations
spelled out in the YANG specification [RFC7950] apply to this
document as well.
6. References
6.1. Normative References
[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
[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 contains an XSLT 1.0 stylesheet [W3C.REC-xslt-19991116]
that is to be used to generate the initial revision of the "iana-dns-
class-rr-type" YANG module. This is achieved by applying the
stylesheet to the XML version of the IANA registry "Domain Name
System (DNS) Parameters" [IANA-DNS-PARAMETERS] that was current at
the time this document was published.
Using the ubiquitous xsltproc tool, the YANG module text can be
generated with this command:
$ xsltproc iana-dns-class-rr-type.xsl dns-parameters.xml
<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
<mailto:iana@iana.org>";
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>

</text>
</variable>
<template name="enum">
<param name="id"/>
<value-of select="concat(' enum ', $id)"/>
<text> {
 value </text>
<value-of select="concat(iana:value, ';
')"/>
<if test="contains(iana:description, 'OBSOLETE')">
<text> status obsolete;
</text>
</if>
<apply-templates select="iana:description"/>
<variable name="xrefs" select="iana:xref[@type!='note']"/>
<if test="$xrefs">
<text> reference
 "</text>
<if test="count($xrefs)>1">- </if>
<apply-templates select="iana:xref[@type!='note']"/>
</if>
<text> }
</text>
</template>
<template match="/">
<value-of select="$module-intro"/>
<apply-templates select="iana:registry[@id='dns-parameters']"/>
<text>}
</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 */

</text>
</template>
<template match="iana:registry[@id='dns-parameters-2']">
<text> typedef dns-class-name {
</text>
<text> type enumeration {
</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.";
}

</text>
</template>
<template match="iana:registry[@id='dns-parameters-4']">
<text> typedef rr-type-name {
</text>
<text> type enumeration {
</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.";
}
</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
 </text>
<value-of select="concat($dq, ., $dq, ';
')"/>
</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>";
</text>
</when>
<otherwise>
<text>
 - </text>
</otherwise>
</choose>
</template>
<template match="iana:person">
<value-of select="concat(iana:name, ' <', iana:uri, '>')"/>
</template>
</stylesheet>
<CODE ENDS>
Authors' Addresses
Ladislav Lhotka
CZ.NIC
Czech Republic
Email: ladislav.lhotka@nic.cz
Petr Špaček
Internet Systems Consortium
Czech Republic
Email: pspacek@isc.org
|