📄 rfc1034.txt
字号:
information, which may be empty. The set of resource informationassociated with a particular name is composed of separate resourcerecords (RRs). The order of RRs in a set is not significant, and neednot be preserved by name servers, resolvers, or other parts of the DNS.When we talk about a specific RR, we assume it has the following:owner which is the domain name where the RR is found.type which is an encoded 16 bit value that specifies the type of the resource in this resource record. Types refer to abstract resources. This memo uses the following types: A a host address CNAME identifies the canonical name of an alias HINFO identifies the CPU and OS used by a host MX identifies a mail exchange for the domain. See [RFC-974 for details. NS the authoritative name server for the domain PTR a pointer to another part of the domain name space SOA identifies the start of a zone of authority]class which is an encoded 16 bit value which identifies a protocol family or instance of a protocol. This memo uses the following classes: IN the Internet system CH the Chaos systemTTL which is the time to live of the RR. This field is a 32 bit integer in units of seconds, an is primarily used by resolvers when they cache RRs. The TTL describes how long a RR can be cached before it should be discarded.Mockapetris [Page 12]RFC 1034 Domain Concepts and Facilities November 1987RDATA which is the type and sometimes class dependent data which describes the resource: A For the IN class, a 32 bit IP address For the CH class, a domain name followed by a 16 bit octal Chaos address. CNAME a domain name. MX a 16 bit preference value (lower is better) followed by a host name willing to act as a mail exchange for the owner domain. NS a host name. PTR a domain name. SOA several fields.The owner name is often implicit, rather than forming an integral partof the RR. For example, many name servers internally form tree or hashstructures for the name space, and chain RRs off nodes. The remainingRR parts are the fixed header (type, class, TTL) which is consistent forall RRs, and a variable part (RDATA) that fits the needs of the resourcebeing described.The meaning of the TTL field is a time limit on how long an RR can bekept in a cache. This limit does not apply to authoritative data inzones; it is also timed out, but by the refreshing policies for thezone. The TTL is assigned by the administrator for the zone where thedata originates. While short TTLs can be used to minimize caching, anda zero TTL prohibits caching, the realities of Internet performancesuggest that these times should be on the order of days for the typicalhost. If a change can be anticipated, the TTL can be reduced prior tothe change to minimize inconsistency during the change, and thenincreased back to its former value following the change.The data in the RDATA section of RRs is carried as a combination ofbinary strings and domain names. The domain names are frequently usedas "pointers" to other data in the DNS.3.6.1. Textual expression of RRsRRs are represented in binary form in the packets of the DNS protocol,and are usually represented in highly encoded form when stored in a nameserver or resolver. In this memo, we adopt a style similar to that usedMockapetris [Page 13]RFC 1034 Domain Concepts and Facilities November 1987in master files in order to show the contents of RRs. In this format,most RRs are shown on a single line, although continuation lines arepossible using parentheses.The start of the line gives the owner of the RR. If a line begins witha blank, then the owner is assumed to be the same as that of theprevious RR. Blank lines are often included for readability.Following the owner, we list the TTL, type, and class of the RR. Classand type use the mnemonics defined above, and TTL is an integer beforethe type field. In order to avoid ambiguity in parsing, type and classmnemonics are disjoint, TTLs are integers, and the type mnemonic isalways last. The IN class and TTL values are often omitted from examplesin the interests of clarity.The resource data or RDATA section of the RR are given using knowledgeof the typical representation for the data.For example, we might show the RRs carried in a message as: ISI.EDU. MX 10 VENERA.ISI.EDU. MX 10 VAXA.ISI.EDU. VENERA.ISI.EDU. A 128.9.0.32 A 10.1.0.52 VAXA.ISI.EDU. A 10.2.0.27 A 128.9.0.33The MX RRs have an RDATA section which consists of a 16 bit numberfollowed by a domain name. The address RRs use a standard IP addressformat to contain a 32 bit internet address.This example shows six RRs, with two RRs at each of three domain names.Similarly we might see: XX.LCS.MIT.EDU. IN A 10.0.0.44 CH A MIT.EDU. 2420This example shows two addresses for XX.LCS.MIT.EDU, each of a differentclass.3.6.2. Aliases and canonical namesIn existing systems, hosts and other resources often have several namesthat identify the same resource. For example, the names C.ISI.EDU andUSC-ISIC.ARPA both identify the same host. Similarly, in the case ofmailboxes, many organizations provide many names that actually go to thesame mailbox; for example Mockapetris@C.ISI.EDU, Mockapetris@B.ISI.EDU,Mockapetris [Page 14]RFC 1034 Domain Concepts and Facilities November 1987and PVM@ISI.EDU all go to the same mailbox (although the mechanismbehind this is somewhat complicated).Most of these systems have a notion that one of the equivalent set ofnames is the canonical or primary name and all others are aliases.The domain system provides such a feature using the canonical name(CNAME) RR. A CNAME RR identifies its owner name as an alias, andspecifies the corresponding canonical name in the RDATA section of theRR. If a CNAME RR is present at a node, no other data should bepresent; this ensures that the data for a canonical name and its aliasescannot be different. This rule also insures that a cached CNAME can beused without checking with an authoritative server for other RR types.CNAME RRs cause special action in DNS software. When a name serverfails to find a desired RR in the resource set associated with thedomain name, it checks to see if the resource set consists of a CNAMErecord with a matching class. If so, the name server includes the CNAMErecord in the response and restarts the query at the domain namespecified in the data field of the CNAME record. The one exception tothis rule is that queries which match the CNAME type are not restarted.For example, suppose a name server was processing a query with for USC-ISIC.ARPA, asking for type A information, and had the following resourcerecords: USC-ISIC.ARPA IN CNAME C.ISI.EDU C.ISI.EDU IN A 10.0.0.52Both of these RRs would be returned in the response to the type A query,while a type CNAME or * query should return just the CNAME.Domain names in RRs which point at another name should always point atthe primary name and not the alias. This avoids extra indirections inaccessing information. For example, the address to name RR for theabove host should be: 52.0.0.10.IN-ADDR.ARPA IN PTR C.ISI.EDUrather than pointing at USC-ISIC.ARPA. Of course, by the robustnessprinciple, domain software should not fail when presented with CNAMEchains or loops; CNAME chains should be followed and CNAME loopssignalled as an error.3.7. QueriesQueries are messages which may be sent to a name server to provoke aMockapetris [Page 15]RFC 1034 Domain Concepts and Facilities November 1987response. In the Internet, queries are carried in UDP datagrams or overTCP connections. The response by the name server either answers thequestion posed in the query, refers the requester to another set of nameservers, or signals some error condition.In general, the user does not generate queries directly, but insteadmakes a request to a resolver which in turn sends one or more queries toname servers and deals with the error conditions and referrals that mayresult. Of course, the possible questions which can be asked in a querydoes shape the kind of service a resolver can provide.DNS queries and responses are carried in a standard message format. Themessage format has a header containing a number of fixed fields whichare always present, and four sections which carry query parameters andRRs.The most important field in the header is a four bit field called anopcode which separates different queries. Of the possible 16 values,one (standard query) is part of the official protocol, two (inversequery and status query) are options, one (completion) is obsolete, andthe rest are unassigned.The four sections are:Question Carries the query name and other query parameters.Answer Carries RRs which directly answer the query.Authority Carries RRs which describe other authoritative servers. May optionally carry the SOA RR for the authoritative data in the answer section.Additional Carries RRs which may be helpful in using the RRs in the other sections.Note that the content, but not the format, of these sections varies withheader opcode.3.7.1. Standard queriesA standard query specifies a target domain name (QNAME), query type(QTYPE), and query class (QCLASS) and asks for RRs which match. Thistype of query makes up such a vast majority of DNS queries that we usethe term "query" to mean standard query unless otherwise specified. TheQTYPE and QCLASS fields are each 16 bits long, and are a superset ofdefined types and classes.Mockapetris [Page 16]RFC 1034 Domain Concepts and Facilities November 1987The QTYPE field may contain:<any type> matches just that type. (e.g., A, PTR).AXFR special zone transfer QTYPE.MAILB matches all mail box related RRs (e.g. MB and MG).* matches all RR types.The QCLASS field may contain:<any class> matches just that class (e.g., IN, CH).* matches aLL RR classes.Using the query domain name, QTYPE, and QCLASS, the name server looksfor matching RRs. In addition to relevant records, the name server mayreturn RRs that point toward a name server that has the desiredinformation or RRs that are expected to be useful in interpreting therelevant RRs. For example, a name server that doesn't have therequested information may know a name server that does; a name serverthat returns a domain name in a relevant RR may also return the RR thatbinds that domain name to an address.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -