Bv9ARM.3.html revision 77071cec207e44f7ef91f0af03830ec3cd00294d
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML EXPERIMENTAL 970324//EN">
<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 Configuration and Logging</H3>
</OL>
<PRE CLASS="2Level-fixed"><A NAME="pgfId=997354"></A>
<CODE>logging {
channel <VAR>named_log</VAR> {
print-time <VAR>yes</VAR>;
print-category <VAR>yes</VAR>;
print-severity <VAR>yes</VAR>;
severity <VAR>info</VAR>;
};
channel <VAR>security_log</VAR> {
print-time <VAR>yes</VAR> ;
};
category <VAR>default</VAR> { named_log; default_debug; };
category security { security_log };
};
// The two corporate subnets.
// Use real IP numbers
// here in the real world.
// The options statement.
options {
check-names master <VAR>fail</VAR>; // Fail on db errors in master zones.
check-names slave <VAR>warn</VAR>; // Warn about db errors
// in slave zones.
check-names response <VAR>warn</VAR>; // Warn about invalid responses
use-id-pool <VAR>yes</VAR>; // Help prevent spoofing
// we've talked to.
listen-on { 192.168.7.20; }; // Listen on this address.
query-source address 192.168.7.20 port 53 ;
// Source queries from port 53
// to get past firewall.
allow-transfer { <VAR>none</VAR>; }; // Don't allow anyone to
// transfer zones.
allow-query { corpnet; }; // Allow only corpnets to query server.
// Helps prevent DoS, spoofing.
allow-recursion { corpnet; }; // Same, except this is for recursion.
};
// Shouldn't be readable to anyone
// except BIND user.
}; // root hints
// localhost
};
type <VAR>master</VAR>; // It's a master zone.
allow-query { <VAR>any</VAR>; }; // Allow anyone to query.
allow-transfer { corpnet; }; // Only allow corp nets to transfer zone.
};
type <VAR>slave</VAR>; // It's a slave zone.
masters { 192.168.4.12; }; // The master is at this address.
notify <VAR>no</VAR>; // Don't worry about NOTIFYing.
allow-query { <VAR>any</VAR>; }; // Allow anyone to query.
};</CODE>
</PRE>
</DIV>
<DIV>
<OL>
<H3 CLASS="2Level">
<A NAME="pgfId=997410">
</A>
3.2 Load Balancing and Round Robin</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 record like 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>
www</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997427">
</A>
10m</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997429">
</A>
IN</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997431">
</A>
A</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997433">
</A>
10.0.0.1</P>
</TD>
</TR>
<TR>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997435">
</A>
</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997437">
</A>
10m</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997439">
</A>
IN</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997441">
</A>
A</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997443">
</A>
10.0.0.2</P>
</TD>
</TR>
<TR>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997445">
</A>
</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997447">
</A>
10m</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997449">
</A>
IN</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997451">
</A>
A</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997453">
</A>
10.0.0.3</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. This is known as cyclic or round-robin ordering.In the example above, the first client will receive the records in the order 1,2,3; the second client will receive them in the order 2,3,1; and the third 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>
RRset Ordering</A>
.</P>
</DIV>
<DIV>
<OL>
<H3 CLASS="2Level">
<A NAME="pgfId=997460">
</A>
3.3 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 and that a query should be initiated to discover the new data. DNS Notify is turned on by default.</P>
<P CLASS="2LevelContinued">
<A NAME="pgfId=1016466">
</A>
DNS Notify is fully documented in RFC 1996. See also the description of the zone option <CODE CLASS="Program-Process">
also-notify</CODE>
Zone Transfers</A>
.</P>
</DIV>
<DIV>
<OL>
<H3 CLASS="2Level">
<A NAME="pgfId=1016467">
</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 CLASS="4Level-fixed1"><A NAME="pgfId=997470"> </A>
dig [@server] domain [<query-type>] [<query-class>]
[+<query-option>] [-<dig-option>] [%comment]</PRE>
<P CLASS="4LevelContinued">
<A NAME="pgfId=997471">
</A>
The usual simple use of dig will take the form</P>
<PRE CLASS="4Level-fixed1"><A NAME="pgfId=997472"> </A>
dig @server domain query-type query-class</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 CLASS="4Level-fixed1"><A NAME="pgfId=997477"> </A>
host [-l] [-v] [-w] [-r] [-d] [-t querytype] [-a] host [server]</PRE>
</DIV>
<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 CLASS="4Level-fixed1"><A NAME="pgfId=997481"> </A>
nslookup [-option ...] [host-to-find | -[server]]</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 CLASS="4Level-fixed1"><A NAME="pgfId=997485"> </A>
nslookup -query=hinfo -timeout=10</PRE>
<P CLASS="4LevelContinued">
<A NAME="pgfId=997486">
</A>
For more information and a list of available commands and options, see the <CODE CLASS="Program-Process">
nslookup</CODE>
man page.</P>
</DIV>
<DIV>
<OL>
<H5 CLASS="4Level">
<A NAME="pgfId=997487">
</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 rndc without any options it will display a usage message.</P>
<P CLASS="4LevelContinued">
<A NAME="pgfId=1012780">
</A>
Usage:</P>
<PRE CLASS="4Level-fixed"><A NAME="pgfId=1012777"> </A>
<CODE CLASS="Program-Process">rndc [-p port] [-m] server command [command ...]</CODE>
</PRE>
<P CLASS="4LevelContinued">
<A NAME="pgfId=997493">
</A>
For more information and a list of available commands and options, see the rndc man page.</P>
</DIV>
<DIV>
<OL>
<H5 CLASS="4Level">
<A NAME="pgfId=997494">
</A>
3.4.1.3 Monitoring Tools</H5>
</OL>
</DIV>
<DIV>
<H5 CLASS="Subhead4">
<A NAME="pgfId=997495">
</A>
MRTG</H5>
<P CLASS="4LevelContinued">
<A NAME="pgfId=997496">
</A>
<CODE CLASS="Program-Process">
MRTG</CODE>
is primarily a router traffic grapher, but can be used to monitor BIND DNS servers, as well. The `stat' script, supplied with MRTG in the MRTG `contrib/stat' directory, can be used to monitor numbers of queries, and counts of various sorts of responses.</P>
</DIV>
</DIV>
</DIV>
</BODY>
</HTML>