📄 tyt11fi.htm
字号:
<TR>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>
</TD>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P>EMAILBOX: A mailbox for error messages
<BR>
</FONT>
<TR>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P>MB
<BR>
</FONT>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P>MADNAME: Now obsolete
<BR>
</FONT>
<TR>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P>MR
<BR>
</FONT>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P>NEWNAME: Renames the address of a specific mailbox
<BR>
</FONT>
<TR>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P>MX
<BR>
</FONT>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P>PREFERENCE: Specifies the precedence for delivery
<BR>
</FONT>
<TR>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>
</TD>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P>EXCHANGE: The domain name of the host that acts as mail exchange
<BR>
</FONT>
<TR>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P>NULL
<BR>
</FONT>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P>Anything can be placed in the data field
<BR>
</FONT>
<TR>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P>PTR
<BR>
</FONT>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P>PTRDNAME: A domain name that acts as a pointer to a location
<BR>
</FONT>
<TR>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P>TXT
<BR>
</FONT>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P>TXTDATA: Any kind of descriptive text
<BR>
</FONT>
<TR>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P>WKS
<BR>
</FONT>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P>Address: A network address
<BR>
</FONT>
<TR>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>
</TD>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P>Protocol: The protocol used
<BR>
</FONT>
<TR>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>
</TD>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P>Bitmap: Used to identify ports and protocols</FONT>
</TABLE></CENTER><BR>
<P><A ID="I2" NAME="I2"></A>The Start of Authority (SOA) resource record format is used to identify the machines within a zone. There is only one SOA record in each zone. The format of the SOA data field is shown in Figure 11.4. The fields in the SOA resource record are used mostly for administration and maintenance of the name server.
<BR>
<P><B><A HREF="11tyt04.gif" tppabs="http://www.mcp.com/817948800/0-672/0-672-30885-1/11tyt04.gif">Figure 11.4. The SOA resource record format.</A></B>
<BR>
<P>The MNAME field is the domain name of the source of data for the zone. The RNAME (responsible person name) field is the domain name of the mailbox of the administrator of the zone. The Serial field contains a version number for the zone. It is incremented when the zone is changed; otherwise, it is maintained as the same value for all such messages.
<BR>
<P>The Refresh Time is the number of seconds between data refreshes for the zone. The Retry Time is the number of seconds to wait between unsuccessful refresh requests. The Expiry Time is the number of seconds after which the zone information is no longer valid. Finally, the Minimum Time is the number of seconds to be used in the Time to Live field of resource records within the zone.
<BR>
<P>Some sample resource records show the simple format used. Address resource records consist of the machine name, the type of resource record indicator (A for Address RRs, for example), and the network address. A sample Address resource record would look like this:
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">TPCI_SCO_4 IN A 143.23.25.7</FONT></PRE>
<P>The IN tags the resource record as an Internet class. This format makes it easy to locate a name and derive its address. (The reverse, going from address to name, is not as easy and requires a special format called <I>IN-ADDR-ARPA</I><I>, </I>which is examined in the next section, "IN-ADDR-ARPA.")
<BR>
<P>For Well-Known Service resource records (WKS, or type 11), the data field of the record contains three fields used to describe the services supported at the address the record refers to. A sample WKS resource record might look like this:
<BR>
<PRE>
<FONT COLOR="#000080">TPCI_SCO.TPCI.COM IN WKS 143.23.1.34.
FTP TCP SMTP TELNET</FONT></PRE>
<P>The full domain name and Internet address are shown, as is the IN to show the Internet class of resource records. The type of record is indicated with the WKS. The protocols supported by the machine at that address are listed after the address. In reality, these are bitmaps that correspond to ports. When the port bit is set to a value of 1, the service is supported. The list of ports and services is defined by an Internet RFC.
<BR>
<BR>
<A ID="E69E147" NAME="E69E147"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B><I>IN-ADDR-ARPA</I></B></FONT></CENTER></H4>
<BR>
<P>The address fields, such as in the Address resource record type, use a special format called <I>IN-ADDR-ARPA</I><I>.</I> This enables reverse mapping from the address to the host name as well as host-to-address mapping. To understand IN-ADDR-ARPA, it is useful to begin with a standard-format resource record. Earlier it was mentioned that resource records are maintained in ASCII format. One of the simplest types of resource record is for the address (type A), as seen earlier. An extract from an address file is shown here:
<BR>
<PRE>
<FONT COLOR="#000080">TPCI_HPWS1 IN A 143.12.2.50
TPCI_HPWS2 IN A 143.12.2.51
TPCI_HPWS3 IN A 143.12.2.52
TPCI_GATEWAY IN A 143.12.2.100
IN A 144.23.56.2
MERLIN IN A 145.23.24.1
SMALLWOOD IN A 134.2.12.75</FONT></PRE>
<P>Each line of the file represents one resource record. In this case, they are all simple entries that have the machine's symbolic name (alias), the class of machine (IN for Internet), A to show it is an Address resource record, and the Internet address. The entry for the machine TPCI_GATEWAY has two corresponding addresses because it is a gateway between two networks. The gateway has a different address on each of the networks, so it has two resource records in the same file. (As with most other code fragments in this book, these example addresses are hypothetical.)
<BR>
<P>This type of file makes name-to-address mapping easy. The name server simply searches for a line with the symbolic name requested by the application and returns the Internet address at the end of that line. The databases are indexed on the name, so these searches proceed very quickly.
<BR>
<P>Searching from the address to the name is not quite as easy. If the resource record files are small, time delays for a manual search are not appreciable, but with large zones there can be thousands or tens of thousands of entries. The index is on the name, so searching for an address can be a slow process. To solve this reverse-mapping problem, IN-ADDR-ARPA was developed. IN-ADDR-ARPA uses the host address as an index to the host's resource record information. When the proper resource record is located, the symbolic name can be extracted.
<BR>
<P>IN-ADDR-ARPA uses the PTR resource record type (see Table 11.1) to point from the address to the name. There might be one of these pointer indexes maintained on each name server. An example of a number-to-name<I> </I>file follows:
<BR>
<PRE>
<FONT COLOR="#000080">23.1.45.143.IN-ADDR-ARPA. PTR TPCI_HPWS_4.TPCI.COM
1.23.64.147.IN-ADDR-ARPA. PTR TPCI_SERVER.MERLIN.COM
3.12.6.123.IN-ADDR-ARPA. PTR BEAST.BEAST.COM
23.143.IN-ADDR-ARPA PTR MERLINGATEWAY.MERLIN.COM</FONT></PRE>
<P>The Internet addresses are reversed in the IN-ADDR-ARPA file for ease of use. As shown in the sample file, it is not necessary to specify the complete address for a gateway because the domain name provides enough routing information.
<BR>
<BR>
<A ID="E69E148" NAME="E69E148"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Messages</B></FONT></CENTER></H4>
<BR>
<P>DNS messages are transferred between name servers to update their resource records. The fields of these messages are quite similar to those of the records themselves. The format of a DNS message is shown in Figure 11.5. The header has several subfields that contain information about the type of question or answer being sent. The rest of the message consists of four variable-length fields, which are further subdivided:
<BR>
<UL>
<LI><B>Question:</B> The information required.
<BR></LI>
<BR>
<LI><B>Answer:</B> The answer to the query (from the RR).
<BR></LI>
<BR>
<LI><B>Authority:</B> The name of other name servers that might have the information requested, if it is not readily available on the targeted name server.
<BR></LI>
<BR>
<LI><B>Additional information:</B> Information that can be provided to answer the query, or the addresses of name servers if the Authority field was used.
<BR></LI>
<BR>
</UL>
<P><B><A HREF="11tyt05.gif" tppabs="http://www.mcp.com/817948800/0-672/0-672-30885-1/11tyt05.gif">Figure 11.5. The DNS message format.</A></B>
<BR>
<P>The DNS message header has several different fields itself, as shown in Figure 11.6. The header is present in all DNS messages. The header ID field is 16 bits long and is used to match queries and answers to each other. The single-bit QR field is set to a value of 0 to indicate a query, or a value of 1 to show a response. The OpCode field is 4 bits long and can have one of the values shown in Table 11.3.
<BR>
<P><B><A HREF="11tyt06.gif" tppabs="http://www.mcp.com/817948800/0-672/0-672-30885-1/11tyt06.gif">Figure 11.6. The DNS message Header format.</A></B>
<BR>
<BR>
<P ALIGN=CENTER>
<CENTER>
<FONT COLOR="#000080"><B>Table 11.3. The DNS message header </B><B>OpCode</B><B> values.</B></FONT></CENTER>
<BR>
<CENTER><TABLE BORDERCOLOR=#000040 BORDER=1 CELLSPACING=2 CELLPADDING=3 >
<TR>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P><B><I>OpCode</I></B><B><I> Value</I></B>
</FONT>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P><B><I>Description</I></B>
</FONT>
<TR>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P>0
<BR>
</FONT>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P>Standard query
<BR>
</FONT>
<TR>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P>1
<BR>
</FONT>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P>Inverse query
<BR>
</FONT>
<TR>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P>2
<BR>
</FONT>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P>Server status request
<BR>
</FONT>
<TR>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P>3–15
<BR>
</FONT>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P>Not used</FONT>
</TABLE></CENTER><BR>
<P>The AA field is the authoritative answer bit. A value of 1 in a response message indicates that the name server is the recognized authority for the queried domain name. The TC (truncation) bit is set to a value of 1 when the message is truncated because of excessive length. Otherwise, the TC bit is set to 0. The RD (recursion desired) bit is set to 1 when the name server is requested to perform a recursive query. The RA (recursion available) bit is set to 1 in a response when the name server can perform recursions.
<BR>
<P>The Z field is 3 bits long and is not used. The RCODE field is 4 bits long and can be set to one of the values shown in Table 11.4.
<BR>
<BR>
<P ALIGN=CENTER>
<CENTER>
<FONT COLOR="#000080"><B>Table 11.4. The DNS message header </B><B>RCODE</B><B> values.</B></FONT></CENTER>
<BR>
<CENTER><TABLE BORDERCOLOR=#000040 BORDER=1 CELLSPACING=2 CELLPADDING=3 >
<TR>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P><B><I>RCODE</I></B><B><I> Value</I></B>
</FONT>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P><B><I>Description</I></B>
</FONT>
<TR>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P>0
<BR>
</FONT>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P>No errors
<BR>
</FONT>
<TR>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P>1
<BR>
</FONT>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P>Format error; name server unable to interpret the query
<BR>
</FONT>
<TR>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P>2
<BR>
</FONT>
<TD BGCOLOR=#80FFFF ><FONT COLOR=#000080>
<P>Name server problems have occurred
<BR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -