<
div class="titlepage"><
div><
div><
h3 class="title">
<
a name="idp71740752"></
a>An Authoritative-only Name Server</
h3></
div></
div></
div>
This sample configuration is for an authoritative-only server
that is the master server for "<
code class="filename">
example.com</
code>"
and a slave for the subdomain "<
code class="filename">
eng.example.com</
code>".
<
pre class="programlisting">
// Do not allow access to cache
allow-query-cache { none; };
// Do not provide recursive service
// Provide a reverse mapping for the loopback
// IP addresses of slave servers allowed to
masters { 192.168.4.12; };
<
div class="section" title="Load Balancing">
<
div class="titlepage"><
div><
div><
h2 class="title" style="clear: both">
<
a name="idp71743568"></
a>Load Balancing</
h2></
div></
div></
div>
A primitive form of load balancing can be achieved in
the <
acronym class="acronym">DNS</
acronym> by using multiple records
(such as multiple A records) for one name.
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
<
div class="informaltable">
<
col width="0.875in" class="1">
<
col width="0.500in" class="2">
<
col width="0.750in" class="3">
<
col width="0.750in" class="4">
<
col width="2.028in" class="5">
Resource Record (RR) Data
<
code class="literal">www</
code>
<
code class="literal">600</
code>
<
code class="literal">IN</
code>
<
code class="literal">A</
code>
<
code class="literal">10.0.0.1</
code>
<
code class="literal">600</
code>
<
code class="literal">IN</
code>
<
code class="literal">A</
code>
<
code class="literal">10.0.0.2</
code>
<
code class="literal">600</
code>
<
code class="literal">IN</
code>
<
code class="literal">A</
code>
<
code class="literal">10.0.0.3</
code>
When a resolver queries for these records, <
acronym class="acronym">BIND</
acronym> 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.
For more detail on ordering responses, check the
<
span class="command"><
strong>rrset-order</
strong></
span> sub-statement in the
<
span class="command"><
strong>options</
strong></
span> statement, see
<
a class="xref" href="Bv9ARM.ch06.html#rrset_ordering" title="RRset Ordering">RRset Ordering</
a>.
<
div class="section" title="Name Server Operations">
<
div class="titlepage"><
div><
div><
h2 class="title" style="clear: both">
<
a name="idp71787728"></
a>Name Server Operations</
h2></
div></
div></
div>
<
div class="section" title="Tools for Use With the Name Server Daemon">
<
div class="titlepage"><
div><
div><
h3 class="title">
<
a name="idp71788624"></
a>Tools for Use With the Name Server Daemon</
h3></
div></
div></
div>
This section describes several indispensable diagnostic,
administrative and monitoring tools available to the system
administrator for controlling and debugging the name server
<
div class="section" title="Diagnostic Tools">
<
div class="titlepage"><
div><
div><
h4 class="title">
<
a name="diagnostic_tools"></
a>Diagnostic Tools</
h4></
div></
div></
div>
The <
span class="command"><
strong>dig</
strong></
span>, <
span class="command"><
strong>host</
strong></
span>, and
<
span class="command"><
strong>nslookup</
strong></
span> programs are all command
for manually querying name servers. They differ in style and
<
div class="variablelist"><
dl>
<
dt><
span class="term"><
a name="dig"></
a><
span class="command"><
strong>dig</
strong></
span></
span></
dt>
The domain information groper (<
span class="command"><
strong>dig</
strong></
span>)
is the most versatile and complete of these lookup tools.
It has two modes: simple interactive
mode for a single query, and batch mode which executes a
each in a list of several query lines. All query options are
<
div class="cmdsynopsis"><
p>
<
code class="command">dig</
code>
[@<
em class="replaceable"><
code>server</
code></
em>]
<
em class="replaceable"><
code>domain</
code></
em>
[<
em class="replaceable"><
code>query-type</
code></
em>]
[<
em class="replaceable"><
code>query-class</
code></
em>]
[+<
em class="replaceable"><
code>query-option</
code></
em>]
[-<
em class="replaceable"><
code>dig-option</
code></
em>]
[%<
em class="replaceable"><
code>comment</
code></
em>]
The usual simple use of <
span class="command"><
strong>dig</
strong></
span> will take the form
<
span class="command"><
strong>dig @server domain query-type query-class</
strong></
span>
For more information and a list of available commands and
options, see the <
span class="command"><
strong>dig</
strong></
span> man
<
dt><
span class="term"><
span class="command"><
strong>host</
strong></
span></
span></
dt>
The <
span class="command"><
strong>host</
strong></
span> utility emphasizes
and ease of use. By default, it converts
between host names and Internet addresses, but its
can be extended with the use of options.
<
div class="cmdsynopsis"><
p>
<
code class="command">host</
code>
[-c <
em class="replaceable"><
code>class</
code></
em>]
[-N <
em class="replaceable"><
code>ndots</
code></
em>]
[-t <
em class="replaceable"><
code>type</
code></
em>]
[-W <
em class="replaceable"><
code>timeout</
code></
em>]
[-R <
em class="replaceable"><
code>retries</
code></
em>]
[-m <
em class="replaceable"><
code>flag</
code></
em>]
<
em class="replaceable"><
code>hostname</
code></
em>
[<
em class="replaceable"><
code>server</
code></
em>]
For more information and a list of available commands and
options, see the <
span class="command"><
strong>host</
strong></
span> man
<
dt><
span class="term"><
span class="command"><
strong>nslookup</
strong></
span></
span></
dt>
<
p><
span class="command"><
strong>nslookup</
strong></
span>
has two modes: interactive and
non-interactive. Interactive mode allows the user to
query name servers 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
<
div class="cmdsynopsis"><
p>
<
code class="command">nslookup</
code>
[<
em class="replaceable"><
code>host-to-find</
code></
em>]
Interactive mode is entered when no arguments are given (the
default name server will be used) or when the first argument
hyphen (`-') and the second argument is the host name or
Non-interactive mode is used when the name or Internet
of the host to be looked up is given as the first argument.
optional second argument specifies the host name or address
Due to its arcane user interface and frequently inconsistent
behavior, we do not recommend the use of <
span class="command"><
strong>nslookup</
strong></
span>.
Use <
span class="command"><
strong>dig</
strong></
span> instead.
<
div class="section" title="Administrative Tools">
<
div class="titlepage"><
div><
div><
h4 class="title">
<
a name="admin_tools"></
a>Administrative Tools</
h4></
div></
div></
div>
Administrative tools play an integral part in the management
<
div class="variablelist"><
dl>
<
a name="named-checkconf"></
a><
span class="term"><
span class="command"><
strong>named-checkconf</
strong></
span></
span>
The <
span class="command"><
strong>named-checkconf</
strong></
span> program
checks the syntax of a <
code class="filename">
named.conf</
code> file.
<
div class="cmdsynopsis"><
p>
<
code class="command">named-checkconf</
code>
[-t <
em class="replaceable"><
code>directory</
code></
em>]
[<
em class="replaceable"><
code>filename</
code></
em>]
<
a name="named-checkzone"></
a><
span class="term"><
span class="command"><
strong>named-checkzone</
strong></
span></
span>
The <
span class="command"><
strong>named-checkzone</
strong></
span> program
<
div class="cmdsynopsis"><
p>
<
code class="command">named-checkzone</
code>
[-c <
em class="replaceable"><
code>class</
code></
em>]
[-o <
em class="replaceable"><
code>output</
code></
em>]
[-t <
em class="replaceable"><
code>directory</
code></
em>]
[-w <
em class="replaceable"><
code>directory</
code></
em>]
[-k <
em class="replaceable"><
code>(ignore|warn|fail)</
code></
em>]
[-n <
em class="replaceable"><
code>(ignore|warn|fail)</
code></
em>]
[-W <
em class="replaceable"><
code>(ignore|warn)</
code></
em>]
<
em class="replaceable"><
code>zone</
code></
em>
[<
em class="replaceable"><
code>filename</
code></
em>]
<
a name="named-compilezone"></
a><
span class="term"><
span class="command"><
strong>named-compilezone</
strong></
span></
span>
Similar to <
span class="command"><
strong>named-checkzone,</
strong></
span> but
it always dumps the zone content to a specified file
(typically in a different format).
<
a name="rndc"></
a><
span class="term"><
span class="command"><
strong>rndc</
strong></
span></
span>
The remote name daemon control
(<
span class="command"><
strong>rndc</
strong></
span>) program allows the
administrator to control the operation of a name server.
Since <
acronym class="acronym">BIND</
acronym> 9.2, <
span class="command"><
strong>rndc</
strong></
span>
supports all the commands of the BIND 8 <
span class="command"><
strong>ndc</
strong></
span>
utility except <
span class="command"><
strong>ndc start</
strong></
span> and
<
span class="command"><
strong>ndc restart</
strong></
span>, which were also
not supported in <
span class="command"><
strong>ndc</
strong></
span>'s
If you run <
span class="command"><
strong>rndc</
strong></
span> without any
it will display a usage message as follows:
<
div class="cmdsynopsis"><
p>
<
code class="command">rndc</
code>
[-c <
em class="replaceable"><
code>config</
code></
em>]
[-s <
em class="replaceable"><
code>server</
code></
em>]
[-p <
em class="replaceable"><
code>port</
code></
em>]
[-y <
em class="replaceable"><
code>key</
code></
em>]
<
em class="replaceable"><
code>command</
code></
em>
[<
em class="replaceable"><
code>command</
code></
em>...]
<
p>See <
a class="xref" href="man.rndc.html" title="rndc"><
span class="refentrytitle"><
span class="application">rndc</
span></
span>(8)</
a> for details of
the available <
span class="command"><
strong>rndc</
strong></
span> commands.
<
span class="command"><
strong>rndc</
strong></
span> requires a configuration file,
communication with the server is authenticated with
digital signatures that rely on a shared secret, and
there is no way to provide that secret other than with a
configuration file. The default location for the
<
span class="command"><
strong>rndc</
strong></
span> configuration file is
location can be specified with the <
code class="option">-c</
code>
option. If the configuration file is not found,
<
span class="command"><
strong>rndc</
strong></
span> will also look in
<
code class="filename">/
etc/
rndc.key</
code> (or whatever
<
code class="varname">sysconfdir</
code> was defined when
the <
acronym class="acronym">BIND</
acronym> build was
The <
code class="filename">
rndc.key</
code> file is
running <
span class="command"><
strong>rndc-confgen -a</
strong></
span> as
<
a class="xref" href="Bv9ARM.ch06.html#controls_statement_definition_and_usage" title="controls Statement Definition and Usage">the section called “<
span class="command"><
strong>controls</
strong></
span> Statement Definition and
The format of the configuration file is similar to
that of <
code class="filename">
named.conf</
code>, but
only four statements, the <
span class="command"><
strong>options</
strong></
span>,
<
span class="command"><
strong>key</
strong></
span>, <
span class="command"><
strong>server</
strong></
span> and
<
span class="command"><
strong>include</
strong></
span>
statements. These statements are what associate the
secret keys to the servers with which they are meant to
be shared. The order of statements is not
The <
span class="command"><
strong>options</
strong></
span> statement has
<
span class="command"><
strong>default-server</
strong></
span>, <
span class="command"><
strong>default-key</
strong></
span>,
and <
span class="command"><
strong>default-port</
strong></
span>.
<
span class="command"><
strong>default-server</
strong></
span> takes a
host name or address argument and represents the server
be contacted if no <
code class="option">-s</
code>
option is provided on the command line.
<
span class="command"><
strong>default-key</
strong></
span> takes
the name of a key as its argument, as defined by a <
span class="command"><
strong>key</
strong></
span> statement.
<
span class="command"><
strong>default-port</
strong></
span> specifies the
<
span class="command"><
strong>rndc</
strong></
span> should connect if no
port is given on the command line or in a
<
span class="command"><
strong>server</
strong></
span> statement.
The <
span class="command"><
strong>key</
strong></
span> statement defines a
by <
span class="command"><
strong>rndc</
strong></
span> when authenticating
<
span class="command"><
strong>named</
strong></
span>. Its syntax is
<
span class="command"><
strong>key</
strong></
span> statement in <
code class="filename">
named.conf</
code>.
The keyword <
strong class="userinput"><
code>key</
code></
strong> is
followed by a key name, which must be a valid
domain name, though it need not actually be hierarchical;
a string like "<
strong class="userinput"><
code>rndc_key</
code></
strong>" is a valid
The <
span class="command"><
strong>key</
strong></
span> statement has two
<
span class="command"><
strong>algorithm</
strong></
span> and <
span class="command"><
strong>secret</
strong></
span>.
While the configuration parser will accept any string as the
to algorithm, currently only the strings
"<
strong class="userinput"><
code>hmac-md5</
code></
strong>",
"<
strong class="userinput"><
code>hmac-sha1</
code></
strong>",
"<
strong class="userinput"><
code>hmac-sha224</
code></
strong>",
"<
strong class="userinput"><
code>hmac-sha256</
code></
strong>",
"<
strong class="userinput"><
code>hmac-sha384</
code></
strong>"
and "<
strong class="userinput"><
code>hmac-sha512</
code></
strong>"
have any meaning. The secret is a base-64 encoded string
as specified in RFC 3548.
The <
span class="command"><
strong>server</
strong></
span> statement
defined using the <
span class="command"><
strong>key</
strong></
span>
The keyword <
strong class="userinput"><
code>server</
code></
strong> is followed by a
host name or address. The <
span class="command"><
strong>server</
strong></
span> statement
has two clauses: <
span class="command"><
strong>key</
strong></
span> and <
span class="command"><
strong>port</
strong></
span>.
The <
span class="command"><
strong>key</
strong></
span> clause specifies the
to be used when communicating with this server, and the
<
span class="command"><
strong>port</
strong></
span> clause can be used to
specify the port <
span class="command"><
strong>rndc</
strong></
span> should
A sample minimal configuration file is as follows:
<
pre class="programlisting">
"c3Ryb25nIGVub3VnaCBmb3IgYSBtYW4gYnV0IG1hZGUgZm9yIGEgd29tYW4K";
default-server 127.0.0.1;
This file, if installed as <
code class="filename">/
etc/
rndc.conf</
code>,
<
code class="prompt">$ </
code><
strong class="userinput"><
code>rndc reload</
code></
strong>
to connect to 127.0.0.1 port 953 and cause the name server
to reload, if a name server on the local machine were
following controls statements:
<
pre class="programlisting">
allow { localhost; } keys { rndc_key; };
and it had an identical key statement for
<
code class="literal">rndc_key</
code>.
Running the <
span class="command"><
strong>rndc-confgen</
strong></
span>
conveniently create a <
code class="filename">
rndc.conf</
code>
file for you, and also display the
corresponding <
span class="command"><
strong>controls</
strong></
span>
statement that you need to
you can run <
span class="command"><
strong>rndc-confgen -a</
strong></
span>
a <
code class="filename">
rndc.key</
code> file and not
<
div class="section" title="Signals">
<
div class="titlepage"><
div><
div><
h3 class="title">
<
a name="idp71886416"></
a>Signals</
h3></
div></
div></
div>
Certain UNIX signals cause the name server to take specific
actions, as described in the following table. These signals can
be sent using the <
span class="command"><
strong>kill</
strong></
span> command.
<
div class="informaltable">
<
col width="1.125in" class="1">
<
col width="4.000in" class="2">
<
p><
span class="command"><
strong>SIGHUP</
strong></
span></
p>
Causes the server to read <
code class="filename">
named.conf</
code> and
<
p><
span class="command"><
strong>SIGTERM</
strong></
span></
p>
Causes the server to clean up and exit.
<
p><
span class="command"><
strong>SIGINT</
strong></
span></
p>
Causes the server to clean up and exit.
<
table width="100%" summary="Navigation footer">
<
td width="40%" align="left">
<
td width="20%" align="center">�</
td>
<
td width="40%" align="right">�<
a accesskey="n" href="Bv9ARM.ch04.html">Next</
a>
<
td width="40%" align="left" valign="top">Chapter�2.�<
acronym class="acronym">BIND</
acronym> Resource Requirements�</
td>
<
td width="20%" align="center"><
a accesskey="h" href="Bv9ARM.html">Home</
a></
td>
<
td width="40%" align="right" valign="top">�Chapter�4.�Advanced DNS Features</
td>