RFC 1035
RFC 1035
RFC 1035
P. Mockapetris
ISI
November 1987
Mockapetris
1
3
3
4
7
7
8
9
10
10
10
11
11
12
12
13
[Page 1]
RFC 1035
November 1987
Mockapetris
13
13
14
14
14
15
15
16
16
17
17
17
18
18
19
20
20
20
21
22
24
25
25
26
28
29
30
32
32
32
33
33
35
36
37
37
37
37
39
39
39
40
40
41
42
[Page 2]
RFC 1035
November 1987
42
43
43
44
46
47
47
48
48
50
54
2. INTRODUCTION
2.1. Overview
The goal of domain names is to provide a mechanism for naming resources
in such a way that the names are usable in different hosts, networks,
protocol families, internets, and administrative organizations.
From the users point of view, domain names are useful as arguments to a
local agent, called a resolver, which retrieves information associated
with the domain name. Thus a user might ask for the host address or
mail information associated with a particular domain name. To enable
the user to request a particular type of information, an appropriate
query type is passed to the resolver with the domain name. To the user,
the domain tree is a single information space; the resolver is
responsible for hiding the distribution of data among name servers from
the user.
From the resolvers point of view, the database that makes up the domain
space is distributed among various name servers. Different parts of the
domain space are stored in different name servers, although a particular
data item will be stored redundantly in two or more name servers. The
resolver starts with knowledge of at least one name server. When the
resolver processes a user query it asks a known name server for the
information; in return, the resolver either receives the desired
information or a referral to another name server. Using these
referrals, resolvers learn the identities and contents of other name
servers. Resolvers are responsible for dealing with the distribution of
the domain space and dealing with the effects of name server failure by
consulting redundant databases in other servers.
Name servers manage two kinds of data. The first kind of data held in
sets called zones; each zone is the complete database for a particular
"pruned" subtree of the domain space. This data is called
authoritative. A name server periodically checks to make sure that its
zones are up to date, and if not, obtains a new copy of updated zones
Mockapetris
[Page 3]
RFC 1035
November 1987
from master files stored locally or in another name server. The second
kind of data is cached data which was acquired by a local resolver.
This data may be incomplete, but improves the performance of the
retrieval process when non-local data is repeatedly accessed. Cached
data is eventually discarded by a timeout mechanism.
This functional structure isolates the problems of user interface,
failure recovery, and distribution in the resolvers and isolates the
database update and refresh problems in the name servers.
2.2. Common configurations
A host can participate in the domain name system in a number of ways,
depending on whether the host runs programs that retrieve information
from the domain system, name servers that answer queries from other
hosts, or various combinations of both functions. The simplest, and
perhaps most typical, configuration is shown below:
Local Host
| Foreign
|
+---------+
+----------+
| +--------+
|
| user queries |
|queries | |
|
| User
|-------------->|
|---------|->|Foreign |
| Program |
| Resolver |
| | Name |
|
|<--------------|
|<--------|--| Server |
|
| user responses|
|responses| |
|
+---------+
+----------+
| +--------+
|
A
|
cache additions |
| references |
V
|
|
+----------+
|
| cache
|
|
+----------+
|
User programs interact with the domain name space through resolvers; the
format of user queries and user responses is specific to the host and
its operating system. User queries will typically be operating system
calls, and the resolver and its cache will be part of the host operating
system. Less capable hosts may choose to implement the resolver as a
subroutine to be linked in with every program that needs its services.
Resolvers answer user queries with information they acquire via queries
to foreign name servers and the local cache.
Note that the resolver may have to make several queries to several
different foreign name servers to answer a particular user query, and
hence the resolution of a user query may involve several network
accesses and an arbitrary amount of time. The queries to foreign name
servers and the corresponding responses have a standard format described
Mockapetris
[Page 4]
RFC 1035
November 1987
| Foreign
|
+---------+
|
/
/|
|
+---------+ |
+----------+
| +--------+
|
| |
|
|responses| |
|
|
| |
|
Name
|---------|->|Foreign |
| Master |-------------->| Server |
| |Resolver|
| files | |
|
|<--------|--|
|
|
|/
|
| queries | +--------+
+---------+
+----------+
|
Here a primary name server acquires information about one or more zones
by reading master files from its local file system, and answers queries
about those zones that arrive from foreign resolvers.
The DNS requires that all zones be redundantly supported by more than
one name server. Designated secondary servers can acquire zones and
check for updates from the primary server using the zone transfer
protocol of the DNS. This configuration is shown below:
Local Host
| Foreign
|
+---------+
|
/
/|
|
+---------+ |
+----------+
| +--------+
|
| |
|
|responses| |
|
|
| |
|
Name
|---------|->|Foreign |
| Master |-------------->| Server |
| |Resolver|
| files | |
|
|<--------|--|
|
|
|/
|
| queries | +--------+
+---------+
+----------+
|
A
|maintenance | +--------+
|
+------------|->|
|
|
queries
| |Foreign |
|
| | Name |
+------------------|--| Server |
maintenance responses | +--------+
In this configuration, the name server periodically establishes a
virtual circuit to a foreign name server to acquire a copy of a zone or
to check that an existing copy has not changed. The messages sent for
Mockapetris
[Page 5]
RFC 1035
November 1987
| Foreign
|
+---------+
+----------+
| +--------+
|
| user queries |
|queries | |
|
| User
|-------------->|
|---------|->|Foreign |
| Program |
| Resolver |
| | Name |
|
|<--------------|
|<--------|--| Server |
|
| user responses|
|responses| |
|
+---------+
+----------+
| +--------+
|
A
|
cache additions |
| references |
V
|
|
+----------+
|
| Shared |
|
| database |
|
+----------+
|
A
|
|
+---------+
refreshes |
| references |
/
/|
|
V
|
+---------+ |
+----------+
| +--------+
|
| |
|
|responses| |
|
|
| |
|
Name
|---------|->|Foreign |
| Master |-------------->| Server |
| |Resolver|
| files | |
|
|<--------|--|
|
|
|/
|
| queries | +--------+
+---------+
+----------+
|
A
|maintenance | +--------+
|
+------------|->|
|
|
queries
| |Foreign |
|
| | Name |
+------------------|--| Server |
maintenance responses | +--------+
The shared database holds domain space data for the local name server
and resolver. The contents of the shared database will typically be a
mixture of authoritative data maintained by the periodic refresh
operations of the name server and cached data from previous resolver
requests. The structure of the domain data and the necessity for
synchronization between name servers and resolvers imply the general
characteristics of this database, but the actual format is up to the
local implementor.
Mockapetris
[Page 6]
RFC 1035
November 1987
| Foreign
|
+---------+
|
|
| responses
|
| Stub
|<--------------------+
|
| Resolver|
|
|
|
|----------------+
|
|
+---------+ recursive
|
|
|
queries
|
|
|
V
|
|
+---------+ recursive
+----------+
| +--------+
|
| queries
|
|queries | |
|
| Stub
|-------------->| Recursive|---------|->|Foreign |
| Resolver|
| Server
|
| | Name |
|
|<--------------|
|<--------|--| Server |
+---------+ responses
|
|responses| |
|
+----------+
| +--------+
| Central |
|
|
cache |
|
+----------+
|
In any case, note that domain components are always replicated for
reliability whenever possible.
2.3. Conventions
The domain system has several conventions dealing with low-level, but
fundamental, issues. While the implementor is free to violate these
conventions WITHIN HIS OWN SYSTEM, he must observe these conventions in
ALL behavior observed from other hosts.
2.3.1. Preferred name syntax
The DNS specifications attempt to be as general as possible in the rules
for constructing domain names. The idea is that the name of any
existing object can be expressed as a domain name with minimal changes.
Mockapetris
[Page 7]
RFC 1035
November 1987
However, when assigning a domain name for an object, the prudent user
will select a name which satisfies both the rules of the domain system
and any existing rules for the object, whether these rules are published
or implied by existing programs.
For example, when naming a mail domain, the user should satisfy both the
rules of this memo and those in RFC-822. When creating a new host name,
the old rules for HOSTS.TXT should be followed. This avoids problems
when old software is converted to use domain names.
The following syntax will result in fewer problems with many
applications that use domain names (e.g., mail, TELNET).
<domain> ::= <subdomain> | " "
<subdomain> ::= <label> | <subdomain> "." <label>
<label> ::= <letter> [ [ <ldh-str> ] <let-dig> ]
<ldh-str> ::= <let-dig-hyp> | <let-dig-hyp> <ldh-str>
<let-dig-hyp> ::= <let-dig> | "-"
<let-dig> ::= <letter> | <digit>
<letter> ::= any one of the 52 alphabetic characters A through Z in
upper case and a through z in lower case
<digit> ::= any one of the ten digits 0 through 9
Note that while upper and lower case letters are allowed in domain
names, no significance is attached to the case. That is, two names with
the same spelling but different case are to be treated as if identical.
The labels must follow the rules for ARPANET host names. They must
start with a letter, end with a letter or digit, and have as interior
characters only letters, digits, and hyphen. There are also some
restrictions on the length. Labels must be 63 characters or less.
For example, the following strings identify hosts in the Internet:
A.ISI.EDU XX.LCS.MIT.EDU SRI-NIC.ARPA
2.3.2. Data Transmission Order
The order of transmission of the header and data described in this
document is resolved to the octet level. Whenever a diagram shows a
Mockapetris
[Page 8]
RFC 1035
November 1987
Mockapetris
[Page 9]
RFC 1035
November 1987
Loss of case sensitive data must be minimized. Thus while data for x.y
and X.Y may both be stored under a single location x.y or X.Y, data for
a.x and B.X would never be stored under A.x, A.X, b.x, or b.X. In
general, this preserves the case of the first label of a domain name,
but forces standardization of interior node labels.
Systems administrators who enter data into the domain database should
take care to represent the data they supply to the domain system in a
case-consistent manner if their system is case-sensitive. The data
distribution system in the domain system will ensure that consistent
representations are preserved.
2.3.4. Size limits
Various objects and parameters in the DNS have size limits. They are
listed below. Some could be easily changed, others are more
fundamental.
labels
63 octets or less
names
TTL
UDP messages
Mockapetris
[Page 10]
RFC 1035
November 1987
3.2. RR definitions
3.2.1. Format
All RRs have the same top level format shown below:
1 1 1 1 1 1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
|
/
/
/
NAME
/
|
|
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
TYPE
|
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
CLASS
|
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
TTL
|
|
|
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
RDLENGTH
|
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--|
/
RDATA
/
/
/
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
where:
NAME
TYPE
CLASS
TTL
RDLENGTH
Mockapetris
[Page 11]
RFC 1035
November 1987
RDATA
TYPE
1 a host address
NS
MD
MF
CNAME
SOA
MB
MG
MR
NULL
10 a null RR (EXPERIMENTAL)
WKS
PTR
HINFO
13 host information
MINFO
MX
15 mail exchange
TXT
16 text strings
Mockapetris
QTYPES are a
In addition, the
[Page 12]
RFC 1035
November 1987
AXFR
MAILB
MAILA
IN
1 the Internet
CS
CH
HS
Mockapetris
[Page 13]
RFC 1035
November 1987
CNAME RRs cause no additional section processing, but name servers may
choose to restart the query at the canonical name in certain cases. See
the description of name server logic in [RFC-1034] for details.
3.3.2. HINFO RDATA format
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
/
CPU
/
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
/
OS
/
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
where:
CPU
OS
Mockapetris
[Page 14]
RFC 1035
November 1987
Mockapetris
[Page 15]
RFC 1035
November 1987
EMAILBX
Mockapetris
[Page 16]
RFC 1035
November 1987
EXCHANGE
Mockapetris
[Page 17]
RFC 1035
November 1987
NULL records cause no additional section processing. NULL RRs are not
allowed in master files. NULLs are used as placeholders in some
experimental extensions of the DNS.
3.3.11. NS RDATA format
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
/
NSDNAME
/
/
/
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
where:
NSDNAME
PTR records cause no additional section processing. These RRs are used
in special domains to point to some other location in the domain space.
These records are simple data, and dont imply any special processing
similar to that performed by CNAME, which identifies aliases. See the
description of the IN-ADDR.ARPA domain for an example.
Mockapetris
[Page 18]
RFC 1035
November 1987
RNAME
SERIAL
REFRESH
RETRY
EXPIRE
Mockapetris
[Page 19]
RFC 1035
November 1987
MINIMUM
Mockapetris
[Page 20]
RFC 1035
November 1987
PROTOCOL
<BIT MAP>
The WKS record is used to describe the well known services supported by
a particular protocol on a particular internet address. The PROTOCOL
field specifies an IP protocol number, and the bit map has one bit per
port of the specified protocol. The first bit corresponds to port 0,
the second to port 1, etc. If the bit map does not include a bit for a
protocol of interest, that bit is assumed zero. The appropriate values
and mnemonics for ports and protocols are specified in [RFC-1010].
For example, if PROTOCOL=TCP (6), the 26th bit corresponds to TCP port
25 (SMTP). If this bit is set, a SMTP server should be listening on TCP
port 25; if zero, SMTP service is not supported on the specified
address.
The purpose of WKS RRs is to provide availability information for
servers for TCP and UDP. If a server supports both TCP and UDP, or has
multiple Internet addresses, then multiple WKS RRs are used.
WKS RRs cause no additional section processing.
In master files, both ports and protocols are expressed using mnemonics
or decimal numbers.
Mockapetris
[Page 21]
RFC 1035
November 1987
Mockapetris
[Page 22]
RFC 1035
November 1987
net 18, and hosts A.ISI.EDU and MULTICS.MIT.EDU. Assuming that ISI
gateway has addresses 10.2.0.22 and 26.0.0.103, and a name MILNETGW.ISI.EDU, and the MIT gateway has addresses 10.0.0.77 and 18.10.0.4
and a name GW.LCS.MIT.EDU, the domain database would contain:
10.IN-ADDR.ARPA.
10.IN-ADDR.ARPA.
18.IN-ADDR.ARPA.
26.IN-ADDR.ARPA.
22.0.2.10.IN-ADDR.ARPA.
103.0.0.26.IN-ADDR.ARPA.
77.0.0.10.IN-ADDR.ARPA.
4.0.10.18.IN-ADDR.ARPA.
103.0.3.26.IN-ADDR.ARPA.
6.0.0.10.IN-ADDR.ARPA.
PTR
PTR
PTR
PTR
PTR
PTR
PTR
PTR
PTR
PTR
MILNET-GW.ISI.EDU.
GW.LCS.MIT.EDU.
GW.LCS.MIT.EDU.
MILNET-GW.ISI.EDU.
MILNET-GW.ISI.EDU.
MILNET-GW.ISI.EDU.
GW.LCS.MIT.EDU.
GW.LCS.MIT.EDU.
A.ISI.EDU.
MULTICS.MIT.EDU.
PTR MILNET-GW.ISI.EDU.
PTR GW.LCS.MIT.EDU.
The program could then originate QTYPE=A, QCLASS=IN queries for MILNETGW.ISI.EDU. and GW.LCS.MIT.EDU. to discover the Internet addresses of
these gateways.
A resolver which wanted to find the host name corresponding to Internet
host address 10.0.0.6 would pursue a query of the form QTYPE=PTR,
QCLASS=IN, QNAME=6.0.0.10.IN-ADDR.ARPA, and would receive:
6.0.0.10.IN-ADDR.ARPA.
PTR MULTICS.MIT.EDU.
Mockapetris
[Page 23]
RFC 1035
November 1987
Mockapetris
[Page 24]
RFC 1035
November 1987
service used a single type (MX) with a "preference" value in the RDATA
section which can order different RRs. However, if any MX RRs are found
in the cache, then all should be there.
4. MESSAGES
4.1. Format
All communications inside of the domain protocol are carried in a single
format called a message. The top level format of message is divided
into 5 sections (some of which are empty in certain cases) shown below:
+---------------------+
|
Header
|
+---------------------+
|
Question
|
+---------------------+
|
Answer
|
+---------------------+
|
Authority
|
+---------------------+
|
Additional
|
+---------------------+
The header section is always present. The header includes fields that
specify which of the remaining sections are present, and also specify
whether the message is a query or a response, a standard query or some
other opcode, etc.
The names of the sections after the header are derived from their use in
standard queries. The question section contains fields that describe a
question to a name server. These fields are a query type (QTYPE), a
query class (QCLASS), and a query domain name (QNAME). The last three
sections have the same format: a possibly empty list of concatenated
resource records (RRs). The answer section contains RRs that answer the
question; the authority section contains RRs that point toward an
authoritative name server; the additional records section contains RRs
which relate to the query, but are not strictly answers for the
question.
Mockapetris
[Page 25]
RFC 1035
November 1987
QR
OPCODE
AA
3-15
Mockapetris
[Page 26]
RFC 1035
November 1987
RD
RA
RCODE
Mockapetris
No error condition
[Page 27]
RFC 1035
November 1987
QDCOUNT
ANCOUNT
NSCOUNT
ARCOUNT
QTYPE
Mockapetris
[Page 28]
RFC 1035
November 1987
QCLASS
TYPE
CLASS
TTL
Mockapetris
[Page 29]
RFC 1035
November 1987
RDLENGTH
RDATA
Mockapetris
[Page 30]
RFC 1035
November 1987
Mockapetris
[Page 31]
RFC 1035
November 1987
defined by a single octet of zeros at 92; the root domain name has no
labels.
4.2. Transport
The DNS assumes that messages will be transmitted as datagrams or in a
byte stream carried by a virtual circuit. While virtual circuits can be
used for any DNS activity, datagrams are preferred for queries due to
their lower overhead and better performance. Zone refresh activities
must use virtual circuits because of the need for reliable transfer.
The Internet supports name server access using TCP [RFC-793] on server
port 53 (decimal) as well as datagram access using UDP [RFC-768] on UDP
port 53 (decimal).
4.2.1. UDP usage
Messages sent using UDP user server port 53 (decimal).
Messages carried by UDP are restricted to 512 bytes (not counting the IP
or UDP headers). Longer messages are truncated and the TC bit is set in
the header.
UDP is not acceptable for zone transfers, but is the recommended method
for standard queries in the Internet. Queries sent using UDP may be
lost, and hence a retransmission strategy is required. Queries or their
responses may be reordered by the network, or by processing in name
servers, so resolvers should not depend on them being returned in order.
The optimal UDP retransmission policy will vary with performance of the
Internet and the needs of the client, but the following are recommended:
- The client should try other servers and server addresses
before repeating a query to a specific address of a server.
- The retransmission interval should be based on prior
statistics if possible. Too aggressive retransmission can
easily slow responses for the community at large. Depending
on how well connected the client is to its expected servers,
the minimum retransmission interval should be 2-5 seconds.
More suggestions on server selection and retransmission policy can be
found in the resolver section of this memo.
4.2.2. TCP usage
Messages sent over TCP connections use server port 53 (decimal). The
message is prefixed with a two byte length field which gives the message
Mockapetris
[Page 32]
RFC 1035
November 1987
length, excluding the two byte length field. This length field allows
the low-level processing to assemble a complete message before beginning
to parse it.
Several connection management policies are recommended:
- The server should not block other activities waiting for TCP
data.
- The server should support multiple connections.
- The server should assume that the client will initiate
connection closing, and should delay closing its end of the
connection until all outstanding client requests have been
satisfied.
- If the server needs to close a dormant connection to reclaim
resources, it should wait until the connection has been idle
for a period on the order of two minutes. In particular, the
server should allow the SOA and AXFR request sequence (which
begins a refresh operation) to be made on a single connection.
Since the server would be unable to answer queries anyway, a
unilateral close or reset may be used instead of a graceful
close.
5. MASTER FILES
Master files are text files that contain RRs in text form. Since the
contents of a zone can be expressed in the form of a list of RRs a
master file is most often used to define a zone, though it can be used
to list a caches contents. Hence, this section first discusses the
format of RRs in a master file, and then the special considerations when
a master file is used to create a zone in some name server.
5.1. Format
The format of these files is a sequence of entries. Entries are
predominantly line-oriented, though parentheses can be used to continue
a list of items across a line boundary, and text literals can contain
CRLF within the text. Any combination of tabs and spaces act as a
delimiter between the separate items that make up an entry. The end of
any line in the master file can end with a comment. The comment starts
with a ";" (semicolon).
The following entries are defined:
<blank>[<comment>]
Mockapetris
[Page 33]
RFC 1035
November 1987
Mockapetris
[Page 34]
RFC 1035
<character-string> is
of characters without
and ending with a ".
occur, except for a "
November 1987
Because these files are text files several special encodings are
necessary to allow arbitrary data to be loaded. In particular:
of the root.
@
\X
\DDD
( )
Mockapetris
[Page 35]
RFC 1035
November 1987
IN
SOA
VENERA
Action\.domains (
20
; SERIAL
7200
; REFRESH
600
; RETRY
3600000; EXPIRE
60)
; MINIMUM
NS
NS
NS
MX
MX
A.ISI.EDU.
VENERA
VAXA
10
VENERA
20
VAXA
26.3.0.103
VENERA
A
A
10.1.0.52
128.9.0.32
VAXA
A
A
10.2.0.27
128.9.0.33
$INCLUDE <SUBSYS>ISI-MAILBOXES.TXT
Where the file <SUBSYS>ISI-MAILBOXES.TXT is:
MOE
LARRY
CURLEY
STOOGES
MB
MB
MB
MG
MG
MG
A.ISI.EDU.
A.ISI.EDU.
A.ISI.EDU.
MOE
LARRY
CURLEY
Note the use of the \ character in the SOA RR to specify the responsible
person mailbox "Action.domains@E.ISI.EDU".
Mockapetris
[Page 36]
RFC 1035
November 1987
Mockapetris
[Page 37]
RFC 1035
November 1987
in real data, a few nodes have a very high branching factor (100-1000 or
more), but the vast majority have a very low branching factor (0-1).
One way to solve the case problem is to store the labels for each node
in two pieces: a standardized-case representation of the label where all
ASCII characters are in a single case, together with a bit mask that
denotes which characters are actually of a different case. The
branching factor diversity can be handled using a simple linked list for
a node until the branching factor exceeds some threshold, and
transitioning to a hash structure after the threshold is exceeded. In
any case, hash structures used to store tree sections must insure that
hash functions and procedures preserve the casing conventions of the
DNS.
The use of separate structures for the different parts of the database
is motivated by several factors:
- The catalog structure can be an almost static structure that
need change only when the system administrator changes the
zones supported by the server. This structure can also be
used to store parameters used to control refreshing
activities.
- The individual data structures for zones allow a zone to be
replaced simply by changing a pointer in the catalog. Zone
refresh operations can build a new structure and, when
complete, splice it into the database via a simple pointer
replacement. It is very important that when a zone is
refreshed, queries should not use old and new data
simultaneously.
- With the proper search procedures, authoritative data in zones
will always "hide", and hence take precedence over, cached
data.
- Errors in zone definitions that cause overlapping zones, etc.,
may cause erroneous responses to queries, but problem
determination is simplified, and the contents of one "bad"
zone cant corrupt another.
- Since the cache is most frequently updated, it is most
vulnerable to corruption during system restarts. It can also
become full of expired RR data. In either case, it can easily
be discarded without disturbing zone data.
A major aspect of database design is selecting a structure which allows
the name server to deal with crashes of the name servers host. State
information which a name server should save across system crashes
Mockapetris
[Page 38]
RFC 1035
November 1987
Mockapetris
[Page 39]
RFC 1035
November 1987
Mockapetris
[Page 40]
RFC 1035
November 1987
Header
Question
Answer
Authority
Additional
+-----------------------------------------+
|
OPCODE=IQUERY, ID=997
|
+-----------------------------------------+
|
<empty>
|
+-----------------------------------------+
|
<anyname> A IN 10.1.0.52
|
+-----------------------------------------+
|
<empty>
|
+-----------------------------------------+
|
<empty>
|
+-----------------------------------------+
This query asks for a question whose answer is the Internet style
address 10.1.0.52. Since the owner name is not known, any domain name
can be used as a placeholder (and is ignored). A single octet of zero,
signifying the root, is usually used because it minimizes the length of
the message. The TTL of the RR is not significant. The response to
this query might be:
Mockapetris
[Page 41]
RFC 1035
Header
Question
Answer
Authority
Additional
November 1987
+-----------------------------------------+
|
OPCODE=RESPONSE, ID=997
|
+-----------------------------------------+
|QTYPE=A, QCLASS=IN, QNAME=VENERA.ISI.EDU |
+-----------------------------------------+
| VENERA.ISI.EDU A IN 10.1.0.52
|
+-----------------------------------------+
|
<empty>
|
+-----------------------------------------+
|
<empty>
|
+-----------------------------------------+
Note that the QTYPE in a response to an inverse query is the same as the
TYPE field in the answer section of the inverse query. Responses to
inverse queries may contain multiple questions when the inverse is not
unique. If the question section in the response is not empty, then the
RR in the answer section is modified to correspond to be an exact copy
of an RR at the first QNAME.
6.4.3. Inverse query processing
Name servers that support inverse queries can support these operations
through exhaustive searches of their databases, but this becomes
impractical as the size of the database increases. An alternative
approach is to invert the database according to the search key.
For name servers that support multiple zones and a large amount of data,
the recommended approach is separate inversions for each zone. When a
particular zone is changed during a refresh, only its inversions need to
be redone.
Support for transfer of this type of inversion may be included in future
versions of the domain system, but is not supported in this version.
6.5. Completion queries and responses
The optional completion services described in RFC-882 and RFC-883 have
been deleted. Redesigned services may become available in the future.
Mockapetris
[Page 42]
RFC 1035
November 1987
7. RESOLVER IMPLEMENTATION
The top levels of the recommended resolver algorithm are discussed in
[RFC-1034]. This section discusses implementation details assuming the
database structure suggested in the name server implementation section
of this memo.
7.1. Transforming a user request into a query
The first step a resolver takes is to transform the clients request,
stated in a format suitable to the local OS, into a search specification
for RRs at a specific name which match a specific QTYPE and QCLASS.
Where possible, the QTYPE and QCLASS should correspond to a single type
and a single class, because this makes the use of cached data much
simpler. The reason for this is that the presence of data of one type
in a cache doesnt confirm the existence or non-existence of data of
other types, hence the only way to be sure is to consult an
authoritative source. If QCLASS=* is used, then authoritative answers
wont be available.
Since a resolver must be able to multiplex multiple requests if it is to
perform its function efficiently, each pending request is usually
represented in some block of state information. This state block will
typically contain:
- A timestamp indicating the time the request began.
The timestamp is used to decide whether RRs in the database
can be used or are out of date. This timestamp uses the
absolute time format previously discussed for RR storage in
zones and caches. Note that when an RRs TTL indicates a
relative time, the RR must be timely, since it is part of a
zone. When the RR has an absolute time, it is part of a
cache, and the TTL of the RR is compared against the timestamp
for the start of the request.
Note that using the timestamp is superior to using a current
time, since it allows RRs with TTLs of zero to be entered in
the cache in the usual manner, but still used by the current
request, even after intervals of many seconds due to system
load, query retransmission timeouts, etc.
- Some sort of parameters to limit the amount of work which will
be performed for this request.
The amount of work which a resolver will do in response to a
client request must be limited to guard against errors in the
database, such as circular CNAME references, and operational
problems, such as network partition which prevents the
Mockapetris
[Page 43]
RFC 1035
November 1987
Mockapetris
[Page 44]
RFC 1035
November 1987
client.
The resolver always starts with a list of server names to query (SLIST).
This list will be all NS RRs which correspond to the nearest ancestor
zone that the resolver knows about. To avoid startup problems, the
resolver should have a set of default servers which it will ask should
it have no current NS RRs which are appropriate. The resolver then adds
to SLIST all of the known addresses for the name servers, and may start
parallel requests to acquire the addresses of the servers when the
resolver has the name, but no addresses, for the name servers.
To complete initialization of SLIST, the resolver attaches whatever
history information it has to the each address in SLIST. This will
usually consist of some sort of weighted averages for the response time
of the address, and the batting average of the address (i.e., how often
the address responded at all to the request). Note that this
information should be kept on a per address basis, rather than on a per
name server basis, because the response time and batting average of a
particular server may vary considerably from address to address. Note
also that this information is actually specific to a resolver address /
server address pair, so a resolver with multiple addresses may wish to
keep separate histories for each of its addresses. Part of this step
must deal with addresses which have no such history; in this case an
expected round trip time of 5-10 seconds should be the worst case, with
lower estimates for the same local network, etc.
Note that whenever a delegation is followed, the resolver algorithm
reinitializes SLIST.
The information establishes a partial ranking of the available name
server addresses. Each time an address is chosen and the state should
be altered to prevent its selection again until all other addresses have
been tried. The timeout for each transmission should be 50-100% greater
than the average predicted value to allow for variance in response.
Some fine points:
- The resolver may encounter a situation where no addresses are
available for any of the name servers named in SLIST, and
where the servers in the list are precisely those which would
normally be used to look up their own addresses. This
situation typically occurs when the glue address RRs have a
smaller TTL than the NS RRs marking delegation, or when the
resolver caches the result of a NS search. The resolver
should detect this condition and restart the search at the
next ancestor zone, or alternatively at the root.
Mockapetris
[Page 45]
RFC 1035
November 1987
Mockapetris
[Page 46]
RFC 1035
November 1987
Mockapetris
[Page 47]
RFC 1035
November 1987
Mockapetris
[Page 48]
RFC 1035
November 1987
1. The query can return a name error indicating that the mailbox
does not exist as a domain name.
In the long term, this would indicate that the specified
mailbox doesnt exist. However, until the use of mailbox
binding is universal, this error condition should be
interpreted to mean that the organization identified by the
global part does not support mailbox binding. The
appropriate procedure is to revert to exchange binding at
this point.
2. The query can return a Mail Rename (MR) RR.
The MR RR carries new mailbox specification in its RDATA
field. The mailer should replace the old mailbox with the
new one and retry the operation.
3. The query can return a MB RR.
The MB RR carries a domain name for a host in its RDATA
field. The mailer should deliver the message to that host
via whatever protocol is applicable, e.g., b,SMTP.
4. The query can return one or more Mail Group (MG) RRs.
This condition means that the mailbox was actually a mailing
list or mail group, rather than a single mailbox. Each MG RR
has a RDATA field that identifies a mailbox that is a member
of the group. The mailer should deliver a copy of the
message to each member.
5. The query can return a MB RR as well as one or more MG RRs.
This condition means the the mailbox was actually a mailing
list. The mailer can either deliver the message to the host
specified by the MB RR, which will in turn do the delivery to
all members, or the mailer can use the MG RRs to do the
expansion itself.
In any of these cases, the response may include a Mail Information
(MINFO) RR. This RR is usually associated with a mail group, but is
legal with a MB. The MINFO RR identifies two mailboxes. One of these
identifies a responsible person for the original mailbox name. This
mailbox should be used for requests to be added to a mail group, etc.
The second mailbox name in the MINFO RR identifies a mailbox that should
receive error messages for mail failures. This is particularly
appropriate for mailing lists when errors in member names should be
reported to a person other than the one who sends a message to the list.
Mockapetris
[Page 49]
RFC 1035
November 1987
[IEN-116]
[RFC-768]
[RFC-793]
[RFC-799]
[RFC-805]
[RFC-810]
[RFC-811]
Mockapetris
See RFC-952.
[Page 50]
RFC 1035
Obsolete.
November 1987
See RFC-953.
[RFC-812]
[RFC-819]
[RFC-821]
[RFC-830]
[RFC-882]
[RFC-883]
[RFC-920]
[RFC-952]
Mockapetris
[Page 51]
RFC 1035
November 1987
[RFC-953]
[RFC-973]
[RFC-974]
[RFC-1001]
[RFC-1002]
[RFC-1010]
[RFC-1031]
[RFC-1032]
Mockapetris
[Page 52]
RFC 1035
November 1987
[Solomon 82]
Mockapetris
[Page 53]
RFC 1035
November 1987
Index
*
13
33, 35
<character-string>
<domain-name>
34
@
35
35
12
Byte order
35
CH
13
Character case
CLASS
11
CNAME
12
Completion
42
CS
13
Hesiod
13
HINFO
12
HS
13
IN
13
IN-ADDR.ARPA domain
Inverse queries
40
Mailbox names
MB
12
MD
12
MF
12
MG
12
MINFO
12
MINIMUM
20
MR
12
MX
12
22
47
NS
12
NULL
12
Port numbers
32
Primary server
5
PTR
12, 18
Mockapetris
[Page 54]
RFC 1035
QCLASS
QTYPE
November 1987
13
12
RDATA
12
RDLENGTH 11
Secondary server
5
SOA
12
Stub resolvers
7
TCP
TXT
TYPE
32
12
11
UDP
32
WKS
12
Mockapetris
[Page 55]