Bv9ARM.3.html revision 9c3531d72aeaad6c5f01efe6a1c82023e1379e4d
<!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.5 2000/06/22 21:53:40 tale Exp $ -->
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="Adobe FrameMaker 5.5/HTML Export Filter">
<LINK REL="STYLESHEET" HREF="Bv9ARM.css">
<TITLE> Section 3. Nameserver Configuration</TITLE></HEAD>
<BODY BGCOLOR="#ffffff">
<H1 CLASS="1Level">
<A NAME="pgfId=997350">
</A>
Section 3. Nameserver Configuration</H1>
<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>
<H3 CLASS="2Level">
<A NAME="pgfId=997353">
</A>
3.1 <A NAME="30164">
</A>
Sample Configuration and Logging</H3>
<PRE CLASS="2Level-fixed"><A NAME="pgfId=997354"></A>
<CODE CLASS="grammar_literal">logging {
channel </CODE><EM CLASS="variable">named_log</EM><CODE CLASS="grammar_literal"> {
file </CODE><CODE CLASS="Program-Process">&quot;</CODE><KBD CLASS="Literal-user-input">logs/named.log</KBD><CODE CLASS="Program-Process">&quot;</CODE><CODE CLASS="grammar_literal">;
print-time </CODE><EM CLASS="variable">yes</EM><CODE CLASS="grammar_literal">;
print-category </CODE><EM CLASS="variable">yes</EM><CODE CLASS="grammar_literal">;
print-severity </CODE><EM CLASS="variable">yes</EM<CODE CLASS="grammar_literal">;
severity </CODE><EM CLASS="variable">info</EM><CODE CLASS="grammar_literal">;
};
<CODE CLASS="grammar_literal">channel</CODE> <EMCLASS="variable">security_log</EM><CODE CLASS="grammar_literal"> {
file </CODE><CODE CLASS="Program-Process">&quot;</CODE><KBD CLASS="Literal-user-input">logs/security.log</KBD><CODE CLASS="Program-Process">&quot;</CODE><CODE CLASS="grammar_literal"> versions</CODE> <EM CLASS="variable">7</EM><CODE CLASS="grammar_literal"> ;
print-time </CODE><EM CLASS="variable">yes</EM><CODE CLASS="grammar_literal">;
};
category </CODE><EM CLASS="variable">default</EM><CODE CLASS="grammar_literal"> { named_log; default_debug; };
category </CODE><EM CLASS="variable">security</EM><CODE CLASS="grammar_literal"> { security_log };
};
// The two corporate subnets.
// Use real IP numbers
// here in the real world.
acl </CODE><EM CLASS="variable">corpnet</EM><CODE CLASS="grammar_literal"> { 192.168.4.0/24; 192.168.7.0/24; };
// The options statement.
options {
directory &quot;</CODE><KBD CLASS="Literal-user-input">/etc/namedb</KBD><CODE CLASS="grammar_literal">&quot;; // Directory
pid-file &quot;</CODE><KBD CLASS="Literal-user-input">named.pid</KBD><CODE CLASS="grammar_literal">&quot;; // Put .pid file in named directory.
check-names master </CODE><EM CLASS="variable">fail</EM><CODE CLASS="grammar_literal">; // Fail on db errors in master zones.
check-names slave </CODE><EM CLASS="variable">warn</EM><CODE CLASS="grammar_literal">; // Warn about db errors
// in slave zones.
check-names response </CODE><EM CLASS="variable">warn</EM><CODE CLASS="grammar_literal">; // Warn about invalid responses
use-id-pool </CODE><EM CLASS="variable">yes</EM><CODE CLASS="grammar_literal">; // Help prevent spoofing
host-statistics </CODE><EM CLASS="variable">yes</EM><CODE CLASS="grammar_literal">; // Keep track of hosts/servers
// 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 { </CODEz<EM CLASS="variable">none</EM><CODE CLASS="grammar_literal">; }; // 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.
};
</CODE>
</PRE>
<PRE CLASS="2Level-fixed"><A NAME="pgfId=1007322"></A>
<CODE CLASS="grammar_literal">include &quot;</CODE><KBD CLASS="Literal-user-input">keys.conf</KBD><CODE CLASS="grammar_literal">&quot;; // Include a keys.conf with
// TSIG/DNSSEC keys.
// Shouldn't be readable to anyone
// except BIND user.
zone &quot;.&quot;{ type </CODE><EM CLASS="variable">hint</EM><CODE CLASS="grammar_literal">; file &quot;</CODE><KBD CLASS="Literal-user-input">local/named.root</KBD><CODE CLASS="grammar_literal">&quot;; };
// root hints</CODE></PRE<PRE CLASS="2Level-fixed"><A NAME="pgfId=997391"></A>
<CODE CLASS="grammar_literal">zone &quot;0.0.127.IN-ADDR.ARPA&quot; {</CODE>
</PRE>
<PRE CLASS="2Level-fixed"><A NAME="pgfId=1079048"></A>
<CODE CLASS="grammar_literal"> type </CODE><EM CLASS="variable">master</EM><CODE CLASS="grammar_literal">; file &quot;</CODE><KBD CLASS="Literal-user-input">local/localhost.db</KBD><CODE CLASS="grammar_literal">&quot;; notify </CODE><EM CLASS="variable">no</EM><CODE CLASS="grammar_literal">;
// localhost
};</CODE>
</PRE><PRE CLASS="2Level-fixed"><A NAME="pgfId=1078744"></A><CODE CLASS="grammar_literal">zone &quot;</CODE><KBD CLASS="Literal-user-input">example.com</KBD><CODE CLASS="grammar_literal">&quot; { // Example zone for &quot;example.com&quot;.
type </CODE><EM CLASS="variable">master</EM><CODE CLASS="grammar_literal">; // It's a master zone.
file &quot;</CODE><KBD CLASS="Literal-user-input">m/example.com.db</KBD><CODE CLASS="grammar_literal">&quot;; // The file is here.
allow-query { </CODE><EM CLASS="variable">any</EM><CODE CLASS="grammar_literal">; }; // Allow anyone to query.
allow-transfer { corpnet; }; // Only allow corp nets to transfer zone.
};</CODE>
<PRE CLASS="2Level-fixed"><A NAME="pgfId=1079157"></A>
<CODE CLASS="grammar_literal">zone &quot;</CODE><KBD CLASS="Literal-user-input">offsite.example.com</KBD><CODE CLASS="grammar_literal">&quot; { // Example zone for an off-site corp zone.
type </CODE><EM CLASS="variable">slave</EM><CODE CLASS="grammar_literal">; // It's a slave zone.
masters { 192.168.4.12; }; // The master is at this address.
file &quot;</CODE><KBD CLASS="Literal-user-input">s/offsite.example.com.db</KBD><CODE CLASS="grammar_literal">&quot;; // The file is here.
notify </CODE><EM CLASS="variable">no</EM><CODE CLASS="grammar_literal">; // Don't worry about NOTIFYing.
allow-query { </CODE><EM CLASS="variable">any</EM><CODE CLASS="grammar_literal">; }; // Allow anyone to query.
};</CODE>
</PRE>
</DIV>
<DIV>
<H3 CLASS="2Level">
<A NAME="pgfId=997410">
</A>
3.2 Load Balancing and Round Robin</H3>
<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 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>
&nbsp;</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>
<CODE CLASS="grammar_literal">
www</CODE>
</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997427"></A>
<CODE CLASS="grammar_literal">
600</CODE>
</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997429"></A>
<CODE CLASS="grammar_literal">
IN</CODE>
</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997431"></A>
<CODE CLASS="grammar_literal">
A</CODE>
</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997433"></A>
<CODE CLASS="grammar_literal">
10.0.0.1</CODE>
</P>
</TD>
</TR>
<TR>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997435"></A>
<CODE CLASS="grammar_literal">
</CODE>
&nbsp;</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997437"></A>
<CODE CLASS="grammar_literal">
600</CODE>
</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997439"></A>
<CODE CLASS="grammar_literal">
IN</CODE>
</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997441"></A>
<CODE CLASS="grammar_literal">
A</CODE>
</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997443"></A>
<CODE CLASS="grammar_literal">
10.0.0.2</CODE>
</P>
</TD>
</TR>
<TR>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997445"></A>
<CODE CLASS="grammar_literal">
</CODE>
&nbsp;</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997447"></A>
<CODE CLASS="grammar_literal">
600</CODE>
</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997449"></A>
<CODE CLASS="grammar_literal">
IN</CODE>
</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997451"></A>
<CODE CLASS="grammar_literal">
A</CODE>
</P>
</TD>
<TD ROWSPAN="1" COLSPAN="1">
<P CLASS="CellBody">
<A NAME="pgfId=997453"></A>
<CODE CLASS="grammar_literal">
10.0.0.3</CODE>
</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>
statement in <A HREF="Bv9ARM.5.html#22766" CLASS="XRef">
RRset Ordering</A>
.</P>
</DIV>
<DIV>
<H3 CLASS="2Level">
<A NAME="pgfId=997460"></A>
3.3 <A NAME="35205"></A>
Notify</H3>
<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.</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>
in <A HREF="Bv9ARM.5.html#32057" CLASS="XRef">
Zone Transfers</A>
. More information about <CODE CLASS="Program-Process">
notify</CODE>
can be found in <A HREF="Bv9ARM.5.html#12205" CLASS="XRef">Boolean Options</A>
.</P>
</DIV>
<DIV>
<H3 CLASS="2Level">
<A NAME="pgfId=1078903">
</A>
3.4 Nameserver Operations</H3>
<DIV>
<H4 CLASS="3Level">
<A NAME="pgfId=997464">
</A>
3.4.1 Tools for Use With the Nameserver Daemon</H4>
<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>
<H5 CLASS="4Level">
<A NAME="pgfId=997466">
</A>
3.4.1.1 Diagnostic Tools</H5>
</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 [&lt;query-type&gt;] [&lt;query-class&gt;]
[+&lt;query-option&gt;] [-&lt;dig-option&gt;] [%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 &quot;set&quot; 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>
<H5 CLASS="4Level">
<A NAME="pgfId=997487">
</A>
3.4.1.2 Administrative Tools</H5>
<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 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 <CODE CLASS="Program-Process">
rndc</CODE>
man page.</P>
</DIV>
</DIV>
</DIV>
<DIV>
<p>Return to <A href="Bv9ARM.html">BINDv9 Administrator Reference Manual</A>
</DIV>
</BODY>
</HTML>