Request for Comments: 4592 NeuStar
Updates: 1034, 2672 July 2006
Category: Standards Track
The Role of Wildcards
in the Domain Name System
Status of This Memo
This document specifies an Internet standards track protocol for the
Internet community, and requests discussion and suggestions for
improvements. Please refer to the current edition of the "Internet
Official Protocol Standards" (STD 1) for the standardization state
and status of this protocol. Distribution of this memo is unlimited.
Copyright Notice
Copyright (C) The Internet Society (2006).
Abstract
This is an update to the wildcard definition of RFC 1034. The
interaction with wildcards and CNAME is changed, an error condition
is removed, and the words defining some concepts central to wildcards
are changed. The overall goal is not to change wildcards, but to
refine the definition of RFC 1034.
Table of Contents
1. Introduction ....................................................3
1.1. Motivation .................................................3
1.2. The Original Definition ....................................3
1.3. Roadmap to This Document ...................................4
1.3.1. New Terms ...........................................5
1.3.2. Changed Text ........................................5
1.3.3. Considerations with Special Types ...................5
1.4. Standards Terminology ......................................6
2. Wildcard Syntax .................................................6
2.1. Identifying a Wildcard .....................................6
2.1.1. Wildcard Domain Name and Asterisk Label .............6
2.1.2. Asterisks and Other Characters ......................7
2.1.3. Non-terminal Wildcard Domain Names ..................7
2.2. Existence Rules ............................................7
2.2.1. An Example ..........................................8
2.2.2. Empty Non-terminals .................................9
2.2.3. Yet Another Definition of Existence ................10
2.3. When Is a Wildcard Domain Name Not Special? ...............10
3. Impact of a Wildcard Domain Name on a Response .................10
3.1. Step 2 ....................................................11
3.2. Step 3 ....................................................11
3.3. Part ’c’ ..................................................12
3.3.1. Closest Encloser and the Source of Synthesis .......12
3.3.2. Closest Encloser and Source of Synthesis Examples ..13
3.3.3. Type Matching ......................................13
4. Considerations with Special Types ..............................14
4.1. SOA RRSet at a Wildcard Domain Name .......................14
4.2. NS RRSet at a Wildcard Domain Name ........................14
4.2.1. Discarded Notions ..................................15
4.3. CNAME RRSet at a Wildcard Domain Name .....................16
4.4. DNAME RRSet at a Wildcard Domain Name .....................16
4.5. SRV RRSet at a Wildcard Domain Name .......................17
4.6. DS RRSet at a Wildcard Domain Name ........................17
4.7. NSEC RRSet at a Wildcard Domain Name ......................18
4.8. RRSIG at a Wildcard Domain Name ...........................18
4.9. Empty Non-terminal Wildcard Domain Name ...................18
5. Security Considerations ........................................18
6. References .....................................................18
6.1. Normative References ......................................18
6.2. Informative References ....................................19
7. Others Contributing to the Document ............................19
1. Introduction
In RFC 1034 [RFC1034], sections 4.3.2 and 4.3.3 describe the
synthesis of answers from special resource records (RRs) called
wildcards. The definition in RFC 1034 is incomplete and has proven
to be confusing. This document describes the wildcard synthesis by
adding to the discussion and making limited modifications.
Modifications are made to close inconsistencies that have led to
interoperability issues. This description does not expand the
service intended by the original definition.
Staying within the spirit and style of the original documents, this
document avoids specifying rules for DNS implementations regarding
wildcards. The intention is to only describe what is needed for
interoperability, not restrict implementation choices. In addition,
consideration is given to minimize any backward-compatibility issues
with implementations that comply with RFC 1034’s definition.
This document is focused on the concept of wildcards as defined in
RFC 1034. Nothing is implied regarding alternative means of
synthesizing resource record sets (RRSets), nor are alternatives
discussed.
1.1. Motivation
Many DNS implementations diverge, in different ways, from the
original definition of wildcards. Although there is clearly a need
to clarify the original documents in light of this alone, the impetus
for this document lay in the engineering of the DNS security
extensions [RFC4033]. With an unclear definition of wildcards, the
design of authenticated denial became entangled.
This document is intended to limit its changes, documenting only
those deemed necessary based on implementation experience, and to
remain as close to the original document as possible. To reinforce
that this document is meant to clarify and adjust and not redefine
wildcards, relevant sections of RFC 1034 are repeated verbatim to
facilitate comparison of the old and new text.
1.2. The Original Definition
The definition of the wildcard concept is comprised by the
documentation of the algorithm by which a name server prepares a
response (in RFC 1034’s section 4.3.2) and the way in which a
resource record (set) is identified as being a source of synthetic
data (section 4.3.3).
This is the definition of the term "wildcard" as it appears in RFC
1034, section 4.3.3.
# In the previous algorithm, special treatment was given to RRs with
# owner names starting with the label "*". Such RRs are called
# wildcards. Wildcard RRs can be thought of as instructions for
# synthesizing RRs. When the appropriate conditions are met, the
# name server creates RRs with an owner name equal to the query name
# and contents taken from the wildcard RRs.
This passage follows the algorithm in which the term wildcard is
first used. In this definition, wildcard refers to resource records.
In other usage, wildcard has referred to domain names, and it has
been used to describe the operational practice of relying on
wildcards to generate answers. It is clear from this that there is a
need to define clear and unambiguous terminology in the process of
discussing wildcards.
The mention of the use of wildcards in the preparation of a response
is contained in step 3, part ’c’ of RFC 1034’s section 4.3.2,
entitled "Algorithm". Note that "wildcard" does not appear in the
algorithm, instead references are made to the "*" label. The portion
of the algorithm relating to wildcards is deconstructed in detail in
section 3 of this document; this is the beginning of the relevant
portion of the "Algorithm".
# c. If at some label, a match is impossible (i.e., the
# corresponding label does not exist), look to see if [...]
# the "*" label exists.
The scope of this document is the RFC 1034 definition of wildcards
and the implications of updates to those documents, such as DNS
Security (DNSSEC). Alternate schemes for synthesizing answers are
not considered. (Note that there is no reference listed. No
document is known to describe any alternate schemes, although there
has been some mention of them in mailing lists.)
1.3. Roadmap to This Document
This document accomplishes these three tasks.
o Defines new terms
o Makes minor changes to avoid conflicting concepts
o Describes the actions of certain resource records as wildcards
1.3.1. New Terms
To help in discussing what resource records are wildcards, two terms
will be defined: "asterisk label" and "wildcard domain name". These
are defined in section 2.1.1.
To assist in clarifying the role of wildcards in the name server
algorithm in RFC 1034, section 4.3.2, "source of synthesis" and
"closest encloser" are defined. These definitions are in section
3.3.1. "Label match" is defined in section 3.2.
The new terms are used to make discussions of wildcards clearer.
Terminology does not directly have an impact on implementations.
1.3.2. Changed Text
The definition of "existence" is changed superficially. This change
will not be apparent to implementations; it is needed to make
descriptions more precise. The change appears in section 2.2.3.
RFC 1034, section 4.3.3, seems to prohibit having two asterisk labels
in a wildcard owner name. With this document, the restriction is
removed entirely. This change and its implications are in section
2.1.3.
The actions when a source of synthesis owns a CNAME RR are changed to
mirror the actions if an exact match name owns a CNAME RR. This is
an addition to the words in RFC 1034, section 4.3.2, step 3, part
’c’. The discussion of this is in section 3.3.3.
Only the latter change represents an impact to implementations. The
definition of existence is not a protocol impact. The change to the
restriction on names is unlikely to have an impact, as RFC 1034
contained no specification on when and how to enforce the
restriction.
1.3.3. Considerations with Special Types
This document describes semantics of wildcard RRSets for
"interesting" types as well as empty non-terminal wildcards.
Understanding these situations in the context of wildcards has been
clouded because these types incur special processing if they are the
result of an exact match. This discussion is in section 4.
These discussions do not have an implementation impact; they cover
existing knowledge of the types, but to a greater level of detail.
1.4. Standards Terminology
This document does not use terms as defined in "Key words for use in
RFCs to Indicate Requirement Levels" [RFC2119].
Quotations of RFC 1034 are denoted by a ’#’ at the start of the line.
References to section "4.3.2" are assumed to refer to RFC 1034’s
section 4.3.2, simply titled "Algorithm".
2. Wildcard Syntax
The syntax of a wildcard is the same as any other DNS resource
record, across all classes and types. The only significant feature
is the owner name.
Because wildcards are encoded as resource records with special names,
they are included in zone transfers and incremental zone transfers
[RFC1995] just as non-wildcard resource records are. This feature
has been under appreciated until discussions on alternative
approaches to wildcards appeared on mailing lists.
2.1. Identifying a Wildcard
To provide a more accurate description of wildcards, the definition
has to start with a discussion of the domain names that appear as
owners. Two new terms are needed, "asterisk label" and "wildcard
domain name".
2.1.1. Wildcard Domain Name and Asterisk Label
A "wildcard domain name" is defined by having its initial (i.e.,
leftmost or least significant) label be, in binary format:
0000 0001 0010 1010 (binary) = 0x01 0x2a (hexadecimal)
The first octet is the normal label type and length for a 1-octet-
long label, and the second octet is the ASCII representation [RFC20]
for the ’*’ character.
A descriptive name of a label equaling that value is an "asterisk
label".
RFC 1034’s definition of wildcard would be "a resource record owned
by a wildcard domain name".
2.1.2. Asterisks and Other Characters
No label values other than that in section 2.1.1 are asterisk labels,
hence names beginning with other labels are never wildcard domain
names. Labels such as ’the*’ and ’**’ are not asterisk labels, so
these labels do not start wildcard domain names.
2.1.3. Non-terminal Wildcard Domain Names
In section 4.3.3, the following is stated:
# .......................... The owner name of the wildcard RRs is
# of the form "*.<anydomain>", where <anydomain> is any domain name.
# <anydomain> should not contain other * labels......................
The restriction is now removed. The original documentation of it is
incomplete and the restriction does not serve any purpose given years
of operational experience.
There are three possible reasons for putting the restriction in
place, but none of the three has held up over time. One is that the
restriction meant that there would never be subdomains of wildcard
domain names, but the restriction as stated still permits
"example.*.example." for instance. Another is that wildcard domain
names are not intended to be empty non-terminals, but this situation
does not disrupt the algorithm in 4.3.2. Finally, "nested" wildcard
domain names are not ambiguous once the concept of the closest
encloser had been documented.
A wildcard domain name can have subdomains. There is no need to
inspect the subdomains to see if there is another asterisk label in
any subdomain.
A wildcard domain name can be an empty non-terminal. (See the
upcoming sections on empty non-terminals.) In this case, any lookup
encountering it will terminate as would any empty non-terminal match.
2.2. Existence Rules
The notion that a domain name ’exists’ is mentioned in the definition
of wildcards. In section 4.3.3 of RFC 1034:
# Wildcard RRs do not apply:
#
...
# - When the query name or a name between the wildcard domain and
# the query name is know[n] to exist. . . .
"Existence" is therefore an important concept in the understanding of
wildcards. Unfortunately, the definition of what exists, in RFC
1034, is unclear. So, in sections 2.2.2. and 2.2.3, another look is
taken at the definition of existence.
2.2.1. An Example
To illustrate what is meant by existence consider this complete zone:
$ORIGIN example.
example. 3600 IN SOA <SOA RDATA>
example. 3600 NS ns.example.com.
example. 3600 NS ns.example.net.
*.example. 3600 TXT "this is a wildcard"
*.example. 3600 MX 10 host1.example.
sub.*.example. 3600 TXT "this is not a wildcard"
host1.example. 3600 A 192.0.2.1
_ssh._tcp.host1.example. 3600 SRV <SRV RDATA>
_ssh._tcp.host2.example. 3600 SRV <SRV RDATA>
subdel.example. 3600 NS ns.example.com.
subdel.example. 3600 NS ns.example.net.
A look at the domain names in a tree structure is helpful:
|
-------------example------------
/ / \ \
/ / \ \
/ / \ \
* host1 host2 subdel
| | |
| | |
sub _tcp _tcp
| |
| |
_ssh _ssh
The following responses would be synthesized from one of the
wildcards in the zone:
QNAME=host3.example. QTYPE=MX, QCLASS=IN
the answer will be a "host3.example. IN MX ..."
QNAME=host3.example. QTYPE=A, QCLASS=IN
the answer will reflect "no error, but no data"
because there is no A RR set at ’*.example.’
QNAME=foo.bar.example. QTYPE=TXT, QCLASS=IN
the answer will be "foo.bar.example. IN TXT ..."
because bar.example. does not exist, but the wildcard
does.
The following responses would not be synthesized from any of the
wildcards in the zone:
QNAME=host1.example., QTYPE=MX, QCLASS=IN
because host1.example. exists
QNAME=sub.*.example., QTYPE=MX, QCLASS=IN
because sub.*.example. exists
QNAME=_telnet._tcp.host1.example., QTYPE=SRV, QCLASS=IN
because _tcp.host1.example. exists (without data)
QNAME=host.subdel.example., QTYPE=A, QCLASS=IN
because subdel.example. exists (and is a zone cut)
QNAME=ghost.*.example., QTYPE=MX, QCLASS=IN
because *.example. exists
The final example highlights one common misconception about
wildcards. A wildcard "blocks itself" in the sense that a wildcard
does not match its own subdomains. That is, "*.example." does not
match all names in the "example." zone; it fails to match the names
below "*.example.". To cover names under "*.example.", another
wildcard domain name is needed--"*.*.example."--which covers all but
its own subdomains.
2.2.2. Empty Non-terminals
Empty non-terminals [RFC2136, section 7.16] are domain names that own
no resource records but have subdomains that do. In section 2.2.1,
"_tcp.host1.example." is an example of an empty non-terminal name.
Empty non-terminals are introduced by this text in section 3.1 of RFC
1034:
# The domain name space is a tree structure. Each node and leaf on
# the tree corresponds to a resource set (which may be empty). The
# domain system makes no distinctions between the uses of the
# interior nodes and leaves, and this memo uses the term "node" to
# refer to both.
The parenthesized "which may be empty" specifies that empty non-
terminals are explicitly recognized and that empty non-terminals
"exist".
Pedantically reading the above paragraph can lead to an
interpretation that all possible domains exist--up to the suggested
limit of 255 octets for a domain name [RFC1035]. For example,
www.example. may have an A RR, and as far as is practically
concerned, is a leaf of the domain tree. But the definition can be
taken to mean that sub.www.example. also exists, albeit with no data.
By extension, all possible domains exist, from the root on down.
As RFC 1034 also defines "an authoritative name error indicating that
the name does not exist" in section 4.3.1, so this apparently is not
the intent of the original definition, justifying the need for an
updated definition in the next section.
2.2.3. Yet Another Definition of Existence
RFC 1034’s wording is fixed by the following paragraph:
The domain name space is a tree structure. Nodes in the tree either
own at least one RRSet and/or have descendants that collectively own
at least one RRSet. A node may exist with no RRSets only if it has
descendants that do; this node is an empty non-terminal.
A node with no descendants is a leaf node. Empty leaf nodes do not
exist.
Note that at a zone boundary, the domain name owns data, including
the NS RR set. In the delegating zone, the NS RR set is not
authoritative, but that is of no consequence here. The domain name
owns data; therefore, it exists.
2.3. When Is a Wildcard Domain Name Not Special?
When a wildcard domain name appears in a message’s query section, no
special processing occurs. An asterisk label in a query name only
matches a single, corresponding asterisk label in the existing zone
tree when the 4.3.2 algorithm is being followed.
When a wildcard domain name appears in the resource data of a record,
no special processing occurs. An asterisk label in that context
literally means just an asterisk.
3. Impact of a Wildcard Domain Name on a Response
RFC 1034’s description of how wildcards impact response generation is
in its section 4.3.2. That passage contains the algorithm followed
by a server in constructing a response. Within that algorithm, step
3, part ’c’ defines the behavior of the wildcard.
The algorithm in section 4.3.2 is not intended to be pseudo-code;
that is, its steps are not intended to be followed in strict order.
The "algorithm" is a suggested means of implementing the
requirements. As such, in step 3, parts ’a’, ’b’, and ’c’ do not
have to be implemented in that order, provided that the result of the
implemented code is compliant with the protocol’s specification.
3.1. Step 2
Step 2 of section 4.3.2 reads:
# 2. Search the available zones for the zone which is the nearest
# ancestor to QNAME. If such a zone is found, go to step 3,
# otherwise step 4.
In this step, the most appropriate zone for the response is chosen.
The significance of this step is that it means all of step 3 is being
performed within one zone. This has significance when considering
whether or not an SOA RR can ever be used for synthesis.
3.2. Step 3
Step 3 is dominated by three parts, labeled ’a’, ’b’, and ’c’. But
the beginning of the step is important and needs explanation.
# 3. Start matching down, label by label, in the zone. The
# matching process can terminate several ways:
The word ’matching’ refers to label matching. The concept is based
in the view of the zone as the tree of existing names. The query
name is considered to be an ordered sequence of labels--as if the
name were a path from the root to the owner of the desired data
(which it is--3rd paragraph of RFC 1034, section 3.1).
The process of label matching a query name ends in exactly one of
three choices, the parts ’a’, ’b’, and ’c’. Either the name is
found, the name is below a cut point, or the name is not found.
Once one of the parts is chosen, the other parts are not considered
(e.g., do not execute part ’c’ and then change the execution path to
finish in part ’b’). The process of label matching is also done
independent of the query type (QTYPE).
Parts ’a’ and ’b’ are not an issue for this clarification as they do
not relate to record synthesis. Part ’a’ is an exact match that
results in an answer; part ’b’ is a referral.
3.3. Part ’c’
The context of part ’c’ is that the process of label matching the
labels of the query name has resulted in a situation in which there
is no corresponding label in the tree. It is as if the lookup has
"fallen off the tree".
# c. If at some label, a match is impossible (i.e., the
# corresponding label does not exist), look to see if [...]
# the "*" label exists.
To help describe the process of looking ’to see if [...] the "*"