📄 rfc1035.txt
字号:
- The gateway data only reflects the existence of a gateway in a manner equivalent to the current HOSTS.TXT file. It doesn't replace the dynamic availability information from GGP or EGP.Mockapetris [Page 23]RFC 1035 Domain Implementation and Specification November 19873.6. Defining new types, classes, and special namespacesThe previously defined types and classes are the ones in use as of thedate of this memo. New definitions should be expected. This sectionmakes some recommendations to designers considering additions to theexisting facilities. The mailing list NAMEDROPPERS@SRI-NIC.ARPA is theforum where general discussion of design issues takes place.In general, a new type is appropriate when new information is to beadded to the database about an existing object, or we need new dataformats for some totally new object. Designers should attempt to definetypes and their RDATA formats that are generally applicable to allclasses, and which avoid duplication of information. New classes areappropriate when the DNS is to be used for a new protocol, etc whichrequires new class-specific data formats, or when a copy of the existingname space is desired, but a separate management domain is necessary.New types and classes need mnemonics for master files; the format of themaster files requires that the mnemonics for type and class be disjoint.TYPE and CLASS values must be a proper subset of QTYPEs and QCLASSesrespectively.The present system uses multiple RRs to represent multiple values of atype rather than storing multiple values in the RDATA section of asingle RR. This is less efficient for most applications, but does keepRRs shorter. The multiple RRs assumption is incorporated in someexperimental work on dynamic update methods.The present system attempts to minimize the duplication of data in thedatabase in order to insure consistency. Thus, in order to find theaddress of the host for a mail exchange, you map the mail domain name toa host name, then the host name to addresses, rather than a directmapping to host address. This approach is preferred because it avoidsthe opportunity for inconsistency.In defining a new type of data, multiple RR types should not be used tocreate an ordering between entries or express different formats forequivalent bindings, instead this information should be carried in thebody of the RR and a single type used. This policy avoids problems withcaching multiple types and defining QTYPEs to match multiple types.For example, the original form of mail exchange binding used two RRtypes one to represent a "closer" exchange (MD) and one to represent a"less close" exchange (MF). The difficulty is that the presence of oneRR type in a cache doesn't convey any information about the otherbecause the query which acquired the cached information might have useda QTYPE of MF, MD, or MAILA (which matched both). The redesignedMockapetris [Page 24]RFC 1035 Domain Implementation and Specification November 1987service used a single type (MX) with a "preference" value in the RDATAsection which can order different RRs. However, if any MX RRs are foundin the cache, then all should be there.4. MESSAGES4.1. FormatAll communications inside of the domain protocol are carried in a singleformat called a message. The top level format of message is dividedinto 5 sections (some of which are empty in certain cases) shown below: +---------------------+ | Header | +---------------------+ | Question | the question for the name server +---------------------+ | Answer | RRs answering the question +---------------------+ | Authority | RRs pointing toward an authority +---------------------+ | Additional | RRs holding additional information +---------------------+The header section is always present. The header includes fields thatspecify which of the remaining sections are present, and also specifywhether the message is a query or a response, a standard query or someother opcode, etc.The names of the sections after the header are derived from their use instandard queries. The question section contains fields that describe aquestion to a name server. These fields are a query type (QTYPE), aquery class (QCLASS), and a query domain name (QNAME). The last threesections have the same format: a possibly empty list of concatenatedresource records (RRs). The answer section contains RRs that answer thequestion; the authority section contains RRs that point toward anauthoritative name server; the additional records section contains RRswhich relate to the query, but are not strictly answers for thequestion.Mockapetris [Page 25]RFC 1035 Domain Implementation and Specification November 19874.1.1. Header section formatThe header contains the following fields: 1 1 1 1 1 1 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | ID | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ |QR| Opcode |AA|TC|RD|RA| Z | RCODE | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | QDCOUNT | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | ANCOUNT | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | NSCOUNT | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | ARCOUNT | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+where:ID A 16 bit identifier assigned by the program that generates any kind of query. This identifier is copied the corresponding reply and can be used by the requester to match up replies to outstanding queries.QR A one bit field that specifies whether this message is a query (0), or a response (1).OPCODE A four bit field that specifies kind of query in this message. This value is set by the originator of a query and copied into the response. The values are: 0 a standard query (QUERY) 1 an inverse query (IQUERY) 2 a server status request (STATUS) 3-15 reserved for future useAA Authoritative Answer - this bit is valid in responses, and specifies that the responding name server is an authority for the domain name in question section. Note that the contents of the answer section may have multiple owner names because of aliases. The AA bitMockapetris [Page 26]RFC 1035 Domain Implementation and Specification November 1987 corresponds to the name which matches the query name, or the first owner name in the answer section.TC TrunCation - specifies that this message was truncated due to length greater than that permitted on the transmission channel.RD Recursion Desired - this bit may be set in a query and is copied into the response. If RD is set, it directs the name server to pursue the query recursively. Recursive query support is optional.RA Recursion Available - this be is set or cleared in a response, and denotes whether recursive query support is available in the name server.Z Reserved for future use. Must be zero in all queries and responses.RCODE Response code - this 4 bit field is set as part of responses. The values have the following interpretation: 0 No error condition 1 Format error - The name server was unable to interpret the query. 2 Server failure - The name server was unable to process this query due to a problem with the name server. 3 Name Error - Meaningful only for responses from an authoritative name server, this code signifies that the domain name referenced in the query does not exist. 4 Not Implemented - The name server does not support the requested kind of query. 5 Refused - The name server refuses to perform the specified operation for policy reasons. For example, a name server may not wish to provide the information to the particular requester, or a name server may not wish to perform a particular operation (e.g., zoneMockapetris [Page 27]RFC 1035 Domain Implementation and Specification November 1987 transfer) for particular data. 6-15 Reserved for future use.QDCOUNT an unsigned 16 bit integer specifying the number of entries in the question section.ANCOUNT an unsigned 16 bit integer specifying the number of resource records in the answer section.NSCOUNT an unsigned 16 bit integer specifying the number of name server resource records in the authority records section.ARCOUNT an unsigned 16 bit integer specifying the number of resource records in the additional records section.4.1.2. Question section formatThe question section is used to carry the "question" in most queries,i.e., the parameters that define what is being asked. The sectioncontains QDCOUNT (usually 1) entries, each of the following format: 1 1 1 1 1 1 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | | / QNAME / / / +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | QTYPE | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | QCLASS | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+where:QNAME a domain name represented as a sequence of labels, where each label consists of a length octet followed by that number of octets. The domain name terminates with the zero length octet for the null label of the root. Note that this field may be an odd number of octets; no padding is used.QTYPE a two octet code which specifies the type of the query. The values for this field include all codes valid for a TYPE field, together with some more general codes which can match more than one type of RR.Mockapetris [Page 28]RFC 1035 Domain Implementation and Specification November 1987QCLASS a two octet code that specifies the class of the query. For example, the QCLASS field is IN for the Internet.4.1.3. Resource record formatThe answer, authority, and additional sections all share the sameformat: a variable number of resource records, where the number ofrecords is specified in the corresponding count field in the header.Each resource record has the following format: 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 | | | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ |
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -