0263-0265.html

来自「linux-unix130.linux.and.unix.ebooks130 l」· HTML 代码 · 共 405 行

HTML
405
字号


<HTML>

<HEAD>

<TITLE>Developer.com - Online Reference Library - 0672311739:RED HAT LINUX 2ND EDITION:TCP/IP Network Management</TITLE>

<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->




<!-- ISBN=0672311739 //-->

<!-- TITLE=RED HAT LINUX 2ND EDITION //-->

<!-- AUTHOR=DAVID PITTS ET AL //-->

<!-- PUBLISHER=MACMILLAN //-->

<!-- IMPRINT=SAMS PUBLISHING //-->

<!-- PUBLICATION DATE=1998 //-->

<!-- CHAPTER=13 //-->

<!-- PAGES=0243-0298 //-->

<!-- UNASSIGNED1 //-->

<!-- UNASSIGNED2 //-->









<P><CENTER>

<a href="0260-0262.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0266-0268.html">Next</A>

</CENTER></P>



<A NAME="PAGENUM-263"><P>Page 263</P></A>













<UL>



<LI>     MX&#151;Mail exchanger



<LI>     CNAME&#151;Canonical name



<LI>     RP and TXT&#151;The documentation entries



</UL>









<H5><A NAME="ch13_ 21">

SOA&#151;Start of Authority

</A></H5>









<P>The SOA record starts the description of a site's DNS entries.

The format of this entry is as follows:

</P>





<!-- CODE //-->

<PRE>

domain.com. IN ns1.domain.com. hostmaster.domain.com. (

    1997082401        ; serial number

    10800            ; refresh rate in seconds (3 hours)

    1800            ; retry in seconds (30 minutes)

    1209600        ; expire in seconds (2 weeks)

    604800 )        ; minimum in seconds (1 week)

</PRE>

<!-- END CODE //-->











<P>The first line begins with the domain for which this

SOA record is authoritative. This entry is followed by

IN to indicate that the Internet standard is being used. The column after the

IN is the primary nameserver for this domain. Finally, the last column specifies the e-mail

address for the person in charge. Note that the e-mail address is not in the standard

user@domain.com form, but instead has the @ symbol replaced by a period. It is good practice to create the

mail alias hostmaster at your site and have all mail sent to it forwarded to the appropriate people.

</P>



<CENTER>

<TABLE BGCOLOR="#FFFF99">

<TR><TD><B>

TIP

</B></TD></TR>

<TR><TD>

<BLOCKQUOTE>

Remember how I said that periods were important in DNS records?

You should have then noticed that all of the fully qualified hostnames were suffixed with a period.

Incorrectly placed periods anywhere in DNS-related files will

cause grief and be difficult to track down later.

</BLOCKQUOTE></TD></TR>

</TABLE></CENTER>

<BR>



<P>At the end of the first line is an open parenthesis. This tells

named that the line continues onto the next line, thereby making the file easier to read.

</P>









<P>The five values presented in subsequent lines detail the characteristics of this record. The

first line is the record's serial number. Whenever you make a change to any entry in this file,

you need to increment this value so that secondary servers know to perform zone transfers.

Typically, the current date in the form YYYYMMDDxx is used, where

YYYY is the year, MM is the month, DD is the day, and

xx is the revision done that day. (This allows for multiple revisions in

one day.)

</P>









<P>The second value is the refresh rate in seconds. This value tells the

secondary DNS servers how often they should query the primary server to see if the records have been updated at all.

</P>









<P>The third value is the retry rate in seconds. If the secondary server tries to contact the

primary DNS server to check for updates but cannot contact it, the secondary server tries again

after retry seconds.

</P>



<A NAME="PAGENUM-264"><P>Page 264</P></A>





<P>The fourth value indicates to secondary servers that have cached the entry that if they

cannot contact the primary server for an update, they should discard the value after the specified

number of seconds. One to two weeks is a good value for this.

</P>









<P>The final value, the minimum entry, tells caching servers how long they should wait before

expiring an entry if they cannot contact the primary DNS server. Five to seven days is a good

guideline for this entry.

</P>









<P>Don't forget to place a closing parenthesis after the fifth value.</P>









<H4><A NAME="ch13_ 22">

NS&#151;Nameserver

</A></H4>









<P>The NS record specifies the authoritative nameservers

for a given domain. A sample line for this is

</P>





<!-- CODE SNIP //-->

<PRE>

IN NS    ns1.domain.com.

IN NS    ns2.domain.com.

</PRE>

<!-- END CODE SNIP //-->











<P>Note that if the domain name for the nameserver applies to the current

SOA record, you do not need to specify the name field in the DNS record.

</P>









<P>In this example, there are two nameservers for the domain,

domain.com: ns1.domain.com and ns2.domain.com. These are fully qualified

hostnames, so they need to have the period to

suffix them. Without the period, named will evaluate their value to be

ns1.domain.com.domain.com, which is not what you're

looking for.

</P>









<H4><A NAME="ch13_ 23">

A&#151;Address Record



</A></H4>









<P>The address record is used for providing translations from hostnames to IP addresses.

There should be an A record for all your machines you want to have a known hostname. A

sample entry using the A record is

</P>





<!-- CODE SNIP //-->

<PRE>

toybox    IN A        192.168.42.59

</PRE>

<!-- END CODE SNIP //-->











<P>In this example, the address is specified for the host

toybox. There is not a period after its name, so

named will assume its domain from the current SOA record, thereby making

it toybox.domain.com.

</P>









<H5><A NAME="ch13_ 24">

PTR&#151;Pointer Record

</A></H5>









<P>The pointer record, also known as reverse resolution record, tells

named how to turn an IP address into a hostname.

PTR records are a little odd, however, in that they should not be in

the same SOA as your A records. You will see why when you configure a small primary DNS

server later in this section.

</P>









<P>A PTR record looks like this:</P>





<!-- CODE SNIP //-->

<PRE>

59.42.168.192.  IN PTR  toybox.domain.com.

</PRE>

<!-- END CODE SNIP //-->





<P>Notice that the IP address to be reverse-resolved is in reverse order and is suffixed with a

period.

</P>



<A NAME="PAGENUM-265"><P>Page 265</P></A>











<H5><A NAME="ch13_ 25">

MX&#151;Mail Exchanger

</A></H5>









<P>The mail exchanger record enables you to specify which host in your network is in charge

of receiving mail from the outside. sendmail uses this record to determine the correct

machine mail needs to be sent to. The format of an

MX record looks like this:

</P>





<!-- CODE SNIP //-->

<PRE>

domain.com.    IN MX 10    mailhub

               IN MX 50    mailhub2

</PRE>

<!-- END CODE SNIP //-->











<P>The first column indicates the hostname for which mail is received. In this case, it is

for domain.com. Based on the previous examples, you might have noticed that you have yet to

specify a machine that answers to domain.com. only, yet the sample

MX record shows that you can accept mail for it. This is an important feature of DNS: You can specify a hostname for

which you accept mail without that hostname having an

A record.

</P>









<P>As expected, the IN class is the second column. The third column specifies that this line is an

MX record. The number after the MX indicates a priority level for that entry. Lower numbers

mean higher priority. In this example, sendmail will try to communicate with

mailhub first. If it cannot successfully communicate with

mailhub, it will then try mailhub2.

</P>









<H5><A NAME="ch13_ 26">

CNAME&#151;Canonical Name

</A></H5>









<P>The CNAME record makes it possible to alias hostnames via DNS. This is useful for giving

common names to servers. For example, we are used to Web servers having the hostname

www, as in www.domain.com. However, you might not want to name the Web server this at all. On

many sites, the machines have a theme to the naming of hosts and placing

www in the middle of that might appear awkward.

</P>









<P>To use a CNAME, you must have another record such as an

A or MX record for that host that specifies its real name&#151;for example,

</P>





<!-- CODE SNIP //-->

<PRE>

toybox    IN A        192.168.42.59

www       IN CNAME    toybox

</PRE>

<!-- END CODE SNIP //-->











<P>In this example, toybox is the real name of the server and

www is its alias.

</P>









<H5><A NAME="ch13_ 27">

RP and TXT&#151;The Documentation Entries

</A></H5>









<P>It is often useful to provide contact information as part of your database&#151;not just as

comments, but as actual records that can be queried by others. This can be accomplished by

using the RP and TXT records.

</P>









<P>TXT records are a free form text entry that allow you to place whatever information you

deem fit. Most often, you will only want to give contact information. Each

TXT record must be tied to a particular hostname&#151;for example,

</P>





<!-- CODE //-->

<PRE>

domain.com.    IN TXT &quot;Contact: Heidi S.&quot;

               IN TXT &quot;Systems Administrator/&quot;

               IN TXT &quot;            Ring Master&quot;

               IN TXT &quot;Voice: (800) 555-1212&quot;

</PRE>

<!-- END CODE //-->





<P><CENTER>

<a href="0260-0262.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0266-0268.html">Next</A>

</CENTER></P>









</td>
</tr>
</table>

<!-- begin footer information -->





</body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?