0266-0268.html
来自「linux-unix130.linux.and.unix.ebooks130 l」· HTML 代码 · 共 348 行
HTML
348 行
<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="0263-0265.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0269-0271.html">Next</A>
</CENTER></P>
<A NAME="PAGENUM-266"><P>Page 266</P></A>
<P>Because TXT records are free form, they do not force you to place contact information there.
As a result, the RP record was created, which explicitly states who is the responsible person for
the specified host—for example,
</P>
<!-- CODE SNIP //-->
<PRE>
domain.com. IN RP heidis.domain.com. domain.com.
</PRE>
<!-- END CODE SNIP //-->
<P>The first column states which host the responsible party is set for. The second column,
IN, defines this record to use the Internet class.
RP designates this to be a responsible party
record. In the fourth column is the e-mail address of the person who is
actually responsible. Notice that the @ symbol has been replaced by a period in this address, much like in the
SOA record. The last column specifies a TXT record that gives additional information. In this example,
it points back to the TXT record for domain.com.
</P>
<H4><A NAME="ch13_ 28">
Configuring a Caching DNS Server
</A></H4>
<P>In order to get a caching nameserver running, you need two files in place. The first is the
/etc/named.boot file, which should look like this:
</P>
<!-- CODE SNIP //-->
<PRE>
directory /etc/dns
cache . root-servers
</PRE>
<!-- END CODE SNIP //-->
<P>This configuration communicates that the data files are kept in the
/etc/dns directory and the root-servers file (kept in
/etc/dns) contains the IP addresses of the root DNS servers for
priming the cache. You can obtain the most recent list of root servers from
ftp://rs.internic.net/domain/named.cache.
</P>
<P>Note that this configuration does not forward any queries it cannot answer to another
server. If you have a primary server at your site, you might want to add a
forwarders line to your/etc/named.boot file.
</P>
<P>When you have the necessary files in place, all you need to do is restart the nameserver with
the following command:/usr/sbin/named.restart
</P>
<H4><A NAME="ch13_ 29">
Configuring a Primary and Secondary DNS Server
</A></H4>
<P>In this example, you will configure a primary DNS server for
domain.com. Your sample domain has a handful of hosts in it and does secondary DNS for an ally company. For this
configuration, it will need four files in addition to the
/etc/named.boot file.
</P>
<P>The /etc/named.boot file for this server is</P>
<!-- CODE //-->
<PRE>
directory /etc/dns
cache . root-servers
primary domain.com domain.hosts
primary 42.168.192.IN-ADDR.ARPA domain.reverse
primary 0.0.127.IN-ADDR.ARPA local.reverse
secondary ally.com 172.16.1.1 ally.hosts.cache
secondary 16.172.IN-ADDR.ARPA 172.16.1.1 ally.reverse.cache
</PRE>
<!-- END CODE //-->
<A NAME="PAGENUM-267"><P>Page 267</P></A>
<P>The first two lines are straight from your caching server. This was done so that it would
perform the caching functions necessary for better performance. The third line specifies the
domain for which you are primary and the file containing the corresponding DNS records.
</P>
<P>The fourth line is related to the PTR record mentioned earlier. So far, your
/etc/named.boot file has only specified the DNS records that enable the translation of names into IP
addresses. However, it is a good practice to allow for the reverse translation to take place. In fact,
some sites on the Internet will not allow you to connect with them unless they can make that
reverse resolution.
</P>
<P>The second column in the fourth line specifies the network for which you are providing
reverse resolution. All reverse mappings exist in the
IN-ADDR.ARPA domain, thereby eliminating any possible confusion regarding the number's purpose. The network and subnetwork parts
of the IP address are placed in reverse order to follow the standard way domain names are
written. (Domain names describe the hostname, then the subnetwork, and then the network,
whereas IP addresses describe the network, subnetwork, and finally hostname.) By placing the IP
address in reverse, it follows the convention established by the actual host and network names.
</P>
<P>The last column in the fourth line simply tells you which file contains the reverse
mapping information. Because reverse mappings require their own
SOA record, they need to be kept in a separate file than the forward mappings.
</P>
<P>The fifth line of the /etc/named.boot file is the reverse
mapping information for the localhost.
</P>
<P>The sixth and seventh lines specify that your server does secondary DNS for
ally.com. The third column makes these entries a little different because they specify the primary DNS
server for ally.com. It is this specified server from which your secondary server will fill its cache.
The last column specifies where the cache files for
ally.com will stay on the system.
</P>
<CENTER>
<TABLE BGCOLOR="#FFFF99">
<TR><TD><B>
TIP
</B></TD></TR>
<TR><TD>
<BLOCKQUOTE>
It is common for sites to pick a naming scheme for all their hosts. This tends to
make remembering their names easier, especially as the site grows in size. For example, the
east wing of the office might use famous music bands to name their machines while the
west wing uses names of musical instruments. This makes locating a machine by its name easier.
</BLOCKQUOTE></TD></TR>
</TABLE></CENTER>
<BR>
<P>Listing 13.1 contains the domain.hosts file.</P>
<P>Listing 13.1. The domain.hosts file.</P>
<!-- CODE //-->
<PRE>
; forward mappings for the domain.com. hosts file
; update history:
; August 6, 1997 - sshah@domain.com
; Setup primary DNS for domain.com.
continues
</PRE>
<!-- END CODE SNIP //-->
<A NAME="PAGENUM-268"><P>Page 268</P></A>
<P>Listing 13.1. continued</P>
<!-- CODE //-->
<PRE>
@ IN SOA domain.com. hostmaster.domain.com. (
1997080600 ; serial number
10800 ; refresh rate (3 hours)
1800 ; retry (30 minutes)
1209600 ; expire (2 weeks)
604800 ) ; minimum (1 week)
IN NS ns1.domain.com
IN NS ns2.domain.com
IN MX 10 mailhub.domain.com
numark IN A 192.168.42.1
ns1 IN CNAME numark
domain.com. IN CNAME numark
mtx IN A 192.168.42.2
ns2 IN CNAME mtx
pioneer IN A 192.168.42.3
denon IN A 192.168.42.4
atus IN A 192.168.42.5
technics IN A 192.168.42.6
vestax IN A 192.168.42.7
www IN CNAME vestax
rane IN A 192.168.42.8
mailhub IN CNAME rane
</PRE>
<!-- END CODE //-->
<P>Notice the use of the @ symbol instead of the domain name? This is a shortcut you can
use because the domain name is specified in the
/etc/named.boot file.
</P>
<P>An additional note regarding names. As mentioned in the preceding tip, using themes in
naming machines is helpful from a management perspective. Listing 13.1 uses the names of
companies that make professional audio gear. In keeping with this sort of theme, however,
you might run into the instance where outsiders expect certain names for your systems such as
your Web server. By default, most people expect Web servers to begin with
www, as in www.domain.com. While you can name the machine
www, two issues arise: First, the naming theme is broken.
If your site is large enough, this can become a problem. Second, if you want to start using a
new Web server, you have to change all the machines' configurations accordingly. It is much
easier to change the CNAME entry in your DNS to point to a new Web server instead.
</P>
<P>Listing 13.2 contains the domain.reverse file.
</P>
<P>Listing 13.2. The domain.reverse file.
</P>
<!-- CODE //-->
<PRE>
; reverse mappings for domain.com
; revision history: sshah@domain.com, Aug. 6, 1997
@ IN SOA domain.com. hostmaster.domain.com. (
1997080600 ; serial number
10800 ; refresh rate (3 hours)
1800 ; retry (30 minutes)
1209600 ; expire (2 weeks)
604800 ) ; minimum (1 week)
IN NS ns1.domain.com
IN NS ns2.domain.com
</PRE>
<!-- END CODE //-->
<P><CENTER>
<a href="0263-0265.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0269-0271.html">Next</A>
</CENTER></P>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?