Bv9ARM.ch03.html revision 1e126d80e1b8a0dd541a733283907656424634dc
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen - Copyright (C) 2004-2015 Internet Systems Consortium, Inc. ("ISC")
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen - Copyright (C) 2000-2003 Internet Software Consortium.
70cb37c37e4dce8f57cd3f882f7444e76b918befTimo Sirainen - Permission to use, copy, modify, and/or distribute this software for any
ff487c974815bdaa2d05a3b834f4c2c841f4cc34Timo Sirainen - purpose with or without fee is hereby granted, provided that the above
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen - copyright notice and this permission notice appear in all copies.
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
98a711be68ba64e1cabf8cacc150af44421e2ac9Timo Sirainen - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
70cb37c37e4dce8f57cd3f882f7444e76b918befTimo Sirainen - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
70cb37c37e4dce8f57cd3f882f7444e76b918befTimo Sirainen - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
70cb37c37e4dce8f57cd3f882f7444e76b918befTimo Sirainen - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen - PERFORMANCE OF THIS SOFTWARE.
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen<title>Chapter�3.�Name Server Configuration</title>
e82af44fe25ca9b88210f313548dc08538e4a677Timo Sirainen<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
e82af44fe25ca9b88210f313548dc08538e4a677Timo Sirainen<link rel="home" href="Bv9ARM.html" title="BIND 9 Administrator Reference Manual">
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen<link rel="up" href="Bv9ARM.html" title="BIND 9 Administrator Reference Manual">
473080c7c0d25ddfdf77e7dfa0ba8f73c6c669d5Timo Sirainen<link rel="prev" href="Bv9ARM.ch02.html" title="Chapter�2.�BIND Resource Requirements">
e82af44fe25ca9b88210f313548dc08538e4a677Timo Sirainen<link rel="next" href="Bv9ARM.ch04.html" title="Chapter�4.�Advanced DNS Features">
94a78eb438622fa53abef1e1726714dacad4b61cTimo Sirainen<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen<table width="100%" summary="Navigation header">
473080c7c0d25ddfdf77e7dfa0ba8f73c6c669d5Timo Sirainen<tr><th colspan="3" align="center">Chapter�3.�Name Server Configuration</th></tr>
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen<a accesskey="p" href="Bv9ARM.ch02.html">Prev</a>�</td>
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen<td width="20%" align="right">�<a accesskey="n" href="Bv9ARM.ch04.html">Next</a>
473080c7c0d25ddfdf77e7dfa0ba8f73c6c669d5Timo Sirainen<div class="titlepage"><div><div><h1 class="title">
473080c7c0d25ddfdf77e7dfa0ba8f73c6c669d5Timo Sirainen<a name="Bv9ARM.ch03"></a>Chapter�3.�Name Server Configuration</h1></div></div></div>
473080c7c0d25ddfdf77e7dfa0ba8f73c6c669d5Timo Sirainen<dt><span class="section"><a href="Bv9ARM.ch03.html#sample_configuration">Sample Configurations</a></span></dt>
473080c7c0d25ddfdf77e7dfa0ba8f73c6c669d5Timo Sirainen<dt><span class="section"><a href="Bv9ARM.ch03.html#cache_only_sample">A Caching-only Name Server</a></span></dt>
473080c7c0d25ddfdf77e7dfa0ba8f73c6c669d5Timo Sirainen<dt><span class="section"><a href="Bv9ARM.ch03.html#auth_only_sample">An Authoritative-only Name Server</a></span></dt>
473080c7c0d25ddfdf77e7dfa0ba8f73c6c669d5Timo Sirainen<dt><span class="section"><a href="Bv9ARM.ch03.html#load_balancing">Load Balancing</a></span></dt>
473080c7c0d25ddfdf77e7dfa0ba8f73c6c669d5Timo Sirainen<dt><span class="section"><a href="Bv9ARM.ch03.html#ns_operations">Name Server Operations</a></span></dt>
473080c7c0d25ddfdf77e7dfa0ba8f73c6c669d5Timo Sirainen<dt><span class="section"><a href="Bv9ARM.ch03.html#tools">Tools for Use With the Name Server Daemon</a></span></dt>
473080c7c0d25ddfdf77e7dfa0ba8f73c6c669d5Timo Sirainen<dt><span class="section"><a href="Bv9ARM.ch03.html#signals">Signals</a></span></dt>
ff487c974815bdaa2d05a3b834f4c2c841f4cc34Timo Sirainen In this chapter we provide some suggested configurations along
ff487c974815bdaa2d05a3b834f4c2c841f4cc34Timo Sirainen with guidelines for their use. We suggest reasonable values for
ff487c974815bdaa2d05a3b834f4c2c841f4cc34Timo Sirainen certain option settings.
ff487c974815bdaa2d05a3b834f4c2c841f4cc34Timo Sirainen<div class="titlepage"><div><div><h2 class="title" style="clear: both">
ff487c974815bdaa2d05a3b834f4c2c841f4cc34Timo Sirainen<a name="sample_configuration"></a>Sample Configurations</h2></div></div></div>
ff487c974815bdaa2d05a3b834f4c2c841f4cc34Timo Sirainen<div class="titlepage"><div><div><h3 class="title">
473080c7c0d25ddfdf77e7dfa0ba8f73c6c669d5Timo Sirainen<a name="cache_only_sample"></a>A Caching-only Name Server</h3></div></div></div>
473080c7c0d25ddfdf77e7dfa0ba8f73c6c669d5Timo Sirainen The following sample configuration is appropriate for a caching-only
473080c7c0d25ddfdf77e7dfa0ba8f73c6c669d5Timo Sirainen name server for use by clients internal to a corporation. All
473080c7c0d25ddfdf77e7dfa0ba8f73c6c669d5Timo Sirainen from outside clients are refused using the <span class="command"><strong>allow-query</strong></span>
473080c7c0d25ddfdf77e7dfa0ba8f73c6c669d5Timo Sirainen option. Alternatively, the same effect could be achieved using
d1414c09cf0d58ac983054e2f4e1a1f329272dcfTimo Sirainen firewall rules.
d1414c09cf0d58ac983054e2f4e1a1f329272dcfTimo Sirainen// Two corporate subnets we wish to allow queries from.
d1414c09cf0d58ac983054e2f4e1a1f329272dcfTimo Sirainenacl corpnets { 192.168.4.0/24; 192.168.7.0/24; };
d1414c09cf0d58ac983054e2f4e1a1f329272dcfTimo Sirainen // Working directory
d1414c09cf0d58ac983054e2f4e1a1f329272dcfTimo Sirainen allow-query { corpnets; };
d1414c09cf0d58ac983054e2f4e1a1f329272dcfTimo Sirainen// Provide a reverse mapping for the loopback
d1414c09cf0d58ac983054e2f4e1a1f329272dcfTimo Sirainen// address 127.0.0.1
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen<div class="titlepage"><div><div><h3 class="title">
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen<a name="auth_only_sample"></a>An Authoritative-only Name Server</h3></div></div></div>
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen This sample configuration is for an authoritative-only server
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen that is the master server for "<code class="filename">example.com</code>"
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen and a slave for the subdomain "<code class="filename">eng.example.com</code>".
965ed6ea3fc8f7637bd0d159d2fdb283a191ce34Timo Sirainen // Working directory
91e4199476cb2add8143c18583fa57e1decfea88Timo Sirainen // Do not allow access to cache
91e4199476cb2add8143c18583fa57e1decfea88Timo Sirainen allow-query-cache { none; };
0727e38ac12efb8963a339daf56255e2be1f29fcTimo Sirainen // This is the default
0727e38ac12efb8963a339daf56255e2be1f29fcTimo Sirainen allow-query { any; };
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen // Do not provide recursive service
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen recursion no;
217f3ed9ef654c1f19c505d9acf14ab1e298d707Timo Sirainen// Provide a reverse mapping for the loopback
217f3ed9ef654c1f19c505d9acf14ab1e298d707Timo Sirainen// address 127.0.0.1
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen// We are the master server for example.com
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen // IP addresses of slave servers allowed to
ac339d4c51420417887bbe1880f9687d8c3b2d4cTimo Sirainen allow-transfer {
ac339d4c51420417887bbe1880f9687d8c3b2d4cTimo Sirainen 192.168.4.14;
ac339d4c51420417887bbe1880f9687d8c3b2d4cTimo Sirainen 192.168.5.53;
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen// We are a slave server for eng.example.com
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen // IP address of eng.example.com master server
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen masters { 192.168.4.12; };
6d239203867965ad42f38747f0b84e7314d215d3Timo Sirainen<div class="titlepage"><div><div><h2 class="title" style="clear: both">
6d239203867965ad42f38747f0b84e7314d215d3Timo Sirainen<a name="load_balancing"></a>Load Balancing</h2></div></div></div>
d1997e794893ce52fce4d2a0cfa46d2f18e26e67Timo Sirainen A primitive form of load balancing can be achieved in
d1997e794893ce52fce4d2a0cfa46d2f18e26e67Timo Sirainen the <acronym class="acronym">DNS</acronym> by using multiple records
d1997e794893ce52fce4d2a0cfa46d2f18e26e67Timo Sirainen (such as multiple A records) for one name.
6d239203867965ad42f38747f0b84e7314d215d3Timo Sirainen For example, if you have three WWW servers with network addresses
70cb37c37e4dce8f57cd3f882f7444e76b918befTimo Sirainen of 10.0.0.1, 10.0.0.2 and 10.0.0.3, a set of records such as the
70cb37c37e4dce8f57cd3f882f7444e76b918befTimo Sirainen following means that clients will connect to each machine one third
The <span class="command"><strong>dig</strong></span>, <span class="command"><strong>host</strong></span>, and
<dt><span class="term"><a name="dig"></a><span class="command"><strong>dig</strong></span></span></dt>
<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>]</p></div>
<div class="cmdsynopsis"><p><code class="command">host</code> [-aCdlnrsTwv] [-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>] [-4] [-6] <em class="replaceable"><code>hostname</code></em> [<em class="replaceable"><code>server</code></em>]</p></div>
<div class="cmdsynopsis"><p><code class="command">nslookup</code> [-option...] [[<em class="replaceable"><code>host-to-find</code></em>] | [- [server]]]</p></div>
<a name="named-checkconf"></a><span class="term"><span class="command"><strong>named-checkconf</strong></span></span>
<div class="cmdsynopsis"><p><code class="command">named-checkconf</code> [-jvz] [-t <em class="replaceable"><code>directory</code></em>] [<em class="replaceable"><code>filename</code></em>]</p></div>
<a name="named-checkzone"></a><span class="term"><span class="command"><strong>named-checkzone</strong></span></span>
<div class="cmdsynopsis"><p><code class="command">named-checkzone</code> [-djqvD] [-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>]</p></div>
<a name="named-compilezone"></a><span class="term"><span class="command"><strong>named-compilezone</strong></span></span>
Since <acronym class="acronym">BIND</acronym> 9.2, <span class="command"><strong>rndc</strong></span>
<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></div>
<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
<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
<span class="command"><strong>key</strong></span>, <span class="command"><strong>server</strong></span> and
<span class="command"><strong>default-server</strong></span>, <span class="command"><strong>default-key</strong></span>,
the name of a key as its argument, as defined by a <span class="command"><strong>key</strong></span> statement.
<span class="command"><strong>key</strong></span> statement in <code class="filename">named.conf</code>.
<span class="command"><strong>algorithm</strong></span> and <span class="command"><strong>secret</strong></span>.
has two clauses: <span class="command"><strong>key</strong></span> and <span class="command"><strong>port</strong></span>.