Bv9ARM.3.html revision cbce6b0c9a9fbe09ceb6c9b28b4a17777950cb7e
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML EXPERIMENTAL 970324//EN">
<!--
- Copyright (C) 2000 Internet Software Consortium.
-
- Permission to use, copy, modify, and distribute this software for any
- purpose with or without fee is hereby granted, provided that the above
- copyright notice and this permission notice appear in all copies.
-
- THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- SOFTWARE.
-->
<!-- $Id: Bv9ARM.3.html,v 1.7 2000/06/29 00:13:39 gson Exp $ -->
<HTML>
<HEAD>
<TITLE> Section 3. Nameserver Configuration</TITLE></HEAD>
<BODY BGCOLOR="#ffffff">
<OL>
<H1 CLASS="1Level">
<A NAME="pgfId=997350">
</A>
Section 3. Nameserver Configuration</H1>
</OL>
<P CLASS="1LevelContinued">
<A NAME="pgfId=997351">
</A>
In this section we provide some suggested configurations along with guidelines for their use. We also address the topic of reasonable option setting.</P>
<DIV>
<OL>
<H3 CLASS="2Level">
<A NAME="pgfId=997353">
</A>
3.1 <A NAME="30164">
</A>
Sample Configurations</H3>
</OL>
<DIV>
<OL>
<H4 CLASS="3Level">
<A NAME="pgfId=1079232">
</A>
3.1.1 A Caching-only Nameserver</H4>
</OL>
<P CLASS="3LevelContinued">
<A NAME="pgfId=1079238">
</A>
The following sample configuration is appropriate for a caching-only name server for use by clients internal to a corporation. All queries from outside clients are refused.</P>
<PRE>
<CODE><STRONG>
// Two corporate subnets we wish to allow queries from.
options {
pid-file "named.pid"; // Put pid file in working dir
allow-query { "corpnets "; };
};
// Root server hints
zone "." { type hint; file "root.hint"; };
// Provide a reverse mapping for the loopback address 127.0.0.1
zone "0.0.127.in-addr.arpa" {
type master;
file "localhost.rev";
notify no;
};</STRONG></CODE>
</PRE>
</DIV>
<DIV>
<OL>
<H4 CLASS="3Level">
<A NAME="pgfId=1079323">
</A>
3.1.2 An Authoritative-only Nameserver</H4>
</OL>
<P CLASS="3LevelContinued">
<A NAME="pgfId=1079327">
</A>
This sample configuration is for an authoritative-only server that is the master server for "<EM CLASS="pathname">
example.com</EM>
" and a slave for the subdomain "<EM CLASS="pathname">
eng.example.com</EM>
".</P>
<PRE>
<CODE><STRONG>options {
pid-file "named.pid"; // Put pid file in working dir
allow-query { any; }; // This is the default
recursion no; // Do not provide recursive service
};
// Root server hints
zone "." { type hint; file "root.hint"; };
// Provide a reverse mapping for the loopback address 127.0.0.1
zone "0.0.127.in-addr.arpa" {
type master;
file "localhost.rev";
notify no;
};
// We are the master server for example.com
zone "example.com" {
type master;
file "example.com.db";
// IP addresses of slave servers allowed to transfer example.com
allow-transfer {
192.168.4.14;
192.168.5.53;
};
};
// We are a slave server for eng.example.com
zone "eng.example.com" {
type slave;
file "eng.example.com.bk";
// IP address of eng.example.com master server
masters { 192.168.4.12; };
};
</STRONG></CODE></PRE>
</DIV>
</DIV>
<DIV>
<OL>
<H3 CLASS="2Level">
<A NAME="pgfId=997410">
</A>
3.2 Load Balancing</H3>
</OL>
<P CLASS="2LevelContinued">
<A NAME="pgfId=997411">
</A>
Primitive load balancing can be achieved in DNS using multiple A records for one name.</P>
<P CLASS="2LevelContinued">
<A NAME="pgfId=997412">
</A>
For example, if you have three WWW servers with network addresses of 10.0.0.1, 10.0.0.2 and 10.0.0.3, a set of records such as the following means that clients will connect to each machine one third of the time:</P>
<PRE CLASS="2Level-fixed1"><A NAME="pgfId=997454"></A>
</PRE>
<TABLE>
<TR>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997415">
</A>
Name</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997417">
</A>
TTL</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997419">
</A>
CLASS</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997421">
</A>
TYPE</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997423">
</A>
Resource Record (RR) Data</P>
</TD>
</TR>
<TR>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997425">
</A>
<EM CLASS="grammar_literal">
www</EM>
</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997427">
</A>
<EM CLASS="grammar_literal">
600</EM>
</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997429">
</A>
<EM CLASS="grammar_literal">
IN</EM>
</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997431">
</A>
<EM CLASS="grammar_literal">
A</EM>
</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997433">
</A>
<EM CLASS="grammar_literal">
10.0.0.1</EM>
</P>
</TD>
</TR>
<TR>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997435">
</A>
<EM CLASS="grammar_literal">
</EM>
</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997437">
</A>
<EM CLASS="grammar_literal">
600</EM>
</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997439">
</A>
<EM CLASS="grammar_literal">
IN</EM>
</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997441">
</A>
<EM CLASS="grammar_literal">
A</EM>
</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997443">
</A>
<EM CLASS="grammar_literal">
10.0.0.2</EM>
</P>
</TD>
</TR>
<TR>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997445">
</A>
<EM CLASS="grammar_literal">
</EM>
</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997447">
</A>
<EM CLASS="grammar_literal">
600</EM>
</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997449">
</A>
<EM CLASS="grammar_literal">
IN</EM>
</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997451">
</A>
<EM CLASS="grammar_literal">
A</EM>
</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997453">
</A>
<EM CLASS="grammar_literal">
10.0.0.3</EM>
</P>
</TD>
</TR>
</TABLE>
<P CLASS="2LevelContinued">
<A NAME="pgfId=997455">
</A>
When a resolver queries for these records, BIND will rotate them and respond to the query with the records in a different order. In the example above, clients will randomly receive records in the order 1, 2, 3; 2, 3, 1; and 3, 1, 2. Most clients will use the first record returned and discard the rest.</P>
<P CLASS="2LevelContinued">
<A NAME="pgfId=997456">
</A>
For more detail on ordering responses, check the <CODE CLASS="Program-Process">
rrset-order</CODE>
substatement in the <CODE CLASS="Program-Process">
options</CODE>
statement under <A HREF="Bv9ARM.6.html#22766" CLASS="XRef">RRset Ordering</A>. This substatement is not supported in BIND 9, and only the ordering scheme described above is available.</P>
</DIV>
<DIV>
<OL>
<H3 CLASS="2Level">
<A NAME="pgfId=997460">
</A>
3.3 <A NAME="35205">
</A>
Notify</H3>
</OL>
<P CLASS="2LevelContinued">
<A NAME="pgfId=997461">
</A>
DNS Notify is a mechanism that allows master nameservers to notify their slave servers of changes to a zone's data. In response to a <CODE CLASS="Program-Process">
NOTIFY</CODE>
from a master server, the slave will check to see that its version of the zone is the current version and, if not, initiate a transfer.</P>
<P CLASS="2LevelContinued">
<A NAME="pgfId=1078896">
</A>
DNS Notify is fully documented in RFC 1996. See also the description of the zone option <CODE CLASS="Program-Process">
also-notify</CODE>
. More information about <CODE CLASS="Program-Process">
notify</CODE>
.</P>
</DIV>
<DIV>
<OL>
<H3 CLASS="2Level">
<A NAME="pgfId=1078903">
</A>
3.4 Nameserver Operations</H3>
</OL>
<DIV>
<OL>
<H4 CLASS="3Level">
<A NAME="pgfId=997464">
</A>
3.4.1 Tools for Use With the Nameserver Daemon</H4>
</OL>
<P CLASS="3LevelContinued">
<A NAME="pgfId=997465">
</A>
There are several indispensable diagnostic, administrative and monitoring tools available to the system administrator for controlling and debugging the nameserver daemon. We describe several in this section </P>
<DIV>
<OL>
<H5 CLASS="4Level">
<A NAME="pgfId=997466">
</A>
3.4.1.1 Diagnostic Tools</H5>
</OL>
</DIV>
<DIV>
<H5 CLASS="Subhead4">
<A NAME="pgfId=997467">
</A>
dig</H5>
<P CLASS="4LevelContinued">
<A NAME="pgfId=997468">
</A>
The domain information groper (<CODE CLASS="Program-Process">
dig</CODE>
) is a command line tool that can be used to gather information from the Domain Name System servers. Dig has two modes: simple interactive mode for a single query, and batch mode which executes a query for each in a list of several query lines. All query options are accessible from the command line.</P>
</DIV>
<DIV>
<H5 CLASS="Subhead4">
<A NAME="pgfId=997469">
</A>
Usage</H5>
<PRE>
<CODE><STRONG>
dig [@server] domain [<query-type>] [<query-class>]
[+<query-option>] [-<dig-option>] [%comment]</STRONG></CODE>
</PRE>
<P CLASS="4LevelContinued">
<A NAME="pgfId=997471">
</A>
The usual simple use of dig will take the form</P>
<PRE>
<CODE><STRONG>
dig @server domain query-type query-class</STRONG></CODE>
</PRE>
<P CLASS="4LevelContinued">
<A NAME="pgfId=997473">
</A>
For more information and a list of available commands and options, see the dig man page.</P>
</DIV>
<DIV>
<H5 CLASS="Subhead4">
<A NAME="pgfId=997474">
</A>
host</H5>
<P CLASS="4LevelContinued">
<A NAME="pgfId=997475">
</A>
The<EM CLASS="pathname">
</EM>
<CODE CLASS="Program-Process">
host</CODE>
<EM CLASS="pathname">
</EM>
utility provides a simple DNS lookup using a command-line interface for looking up Internet hostnames. By default, the utility converts between host names and Internet addresses, but its functionality can be extended with the use of options.</P>
</DIV>
<DIV>
<H5 CLASS="Subhead4">
<A NAME="pgfId=997476">
</A>
Usage</H5>
<PRE>
<CODE><STRONG>
host [-aCdlrTwv] [-c class] [-N ndots] [-t type]
[-W timeout] [-R retries] hostname [server]
</STRONG></CODE></PRE>
<DIV>
<H5 CLASS="Subhead4">
<A NAME="pgfId=997478">
</A>
nslookup</H5>
<P CLASS="4LevelContinued">
<A NAME="pgfId=997479">
</A>
<CODE CLASS="Program-Process">
nslookup</CODE>
is a program used to query Internet domain nameservers. <CODE CLASS="Program-Process">
nslookup</CODE>
has two modes: interactive and non-interactive. Interactive mode allows the user to query nameservers for information about various hosts and domains or to print a list of hosts in a domain. Non-interactive mode is used to print just the name and requested information for a host or domain.</P>
</DIV>
<DIV>
<H5 CLASS="Subhead4">
<A NAME="pgfId=997480">
</A>
Usage</H5>
<PRE>
<CODE><STRONG>
nslookup [-option ...] [host-to-find | -[server]]</STRONG></CODE>
</PRE>
<P CLASS="4LevelContinued">
<A NAME="pgfId=997482">
</A>
Interactive mode is entered when no arguments are given (the default nameserver will be used) or when the first argument is a hyphen (`-') and the second argument is the host name or Internet address of a nameserver.</P>
<P CLASS="4LevelContinued">
<A NAME="pgfId=997483">
</A>
Non-interactive mode is used when the name or Internet address of the host to be looked up is given as the first argument. The optional second argument specifies the host name or address of a nameserver.</P>
<P CLASS="4LevelContinued">
<A NAME="pgfId=997484">
</A>
The options listed under the "set" command (see the <CODE CLASS="Program-Process">
nslookup</CODE>
man page for details) can be specified in the <EM CLASS="pathname">
.nslookuprc</EM>
file in the user's home directory if they are listed one per line. Options can also be specified on the command line if they precede the arguments and are prefixed with a hyphen. For example, to change the default query type to host information, and the initial time-out to 10 seconds, type:</P>
<PRE>
<CODE><STRONG>
nslookup -query=hinfo -timeout=10</STRONG></CODE>
</PRE>
<P CLASS="4LevelContinued">
<A NAME="pgfId=1079183">
</A>
For more information and a list of available commands and options, see the <CODE CLASS="Program-Process">
nslookup</CODE>
man page.</P>
<P CLASS="4LevelContinued">
<A NAME="pgfId=1079184">
</A>
Due to its arcane user interface and frequently inconsistent behavior, we do not recommend the use of <CODE CLASS="Program-Process">
nslookup</CODE>
, and it is not installed by default when installing BIND 9. Use <CODE CLASS="Program-Process">
dig</CODE>
instead.</P>
</DIV>
<DIV>
<OL>
<H5 CLASS="4Level">
<A NAME="pgfId=1079185">
</A>
3.4.1.2 Administrative Tools</H5>
</OL>
<P CLASS="4LevelContinued">
<A NAME="pgfId=997488">
</A>
Administrative tools play an integral part in the management of a server.</P>
</DIV>
<DIV>
<H5 CLASS="Subhead4">
<A NAME="pgfId=997489">
</A>
rndc</H5>
<P CLASS="4LevelContinued">
<A NAME="pgfId=997490">
</A>
The remote name daemon control (<CODE CLASS="Program-Process">
rndc</CODE>
) program is a program that allows the system administrator to control the operation of a nameserver. If you run <CODE CLASS="Program-Process">
rndc</CODE>
without any options it will display a usage message.</P>
<P CLASS="4LevelContinued">
<A NAME="pgfId=1012780">
</A>
Usage:</P>
<PRE>
<CODE><STRONG>
rndc [-p port] [-m] server command [command ...]
</STRONG></CODE></PRE>
<P CLASS="4LevelContinued">
<A NAME="pgfId=997493">
</A>
For more information and a list of available commands and options, see the <CODE CLASS="Program-Process">
rndc</CODE>
man page.</P>
</DIV>
</DIV>
</DIV>
<HR ALIGN="center">
</BODY>
</HTML>