man.rndc.conf.html revision ad8f23aed6c75f94f238c1f23f4e17515d28eb55
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi - Copyright (C) 2004-2015 Internet Systems Consortium, Inc. ("ISC")
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi - Copyright (C) 2000-2003 Internet Software Consortium.
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi - Permission to use, copy, modify, and/or distribute this software for any
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi - purpose with or without fee is hereby granted, provided that the above
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi - copyright notice and this permission notice appear in all copies.
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi - PERFORMANCE OF THIS SOFTWARE.
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi<!-- $Id$ -->
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi<meta name="generator" content="DocBook XSL Stylesheets V1.71.1">
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi<link rel="start" href="Bv9ARM.html" title="BIND 9 Administrator Reference Manual">
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi<link rel="up" href="Bv9ARM.ch13.html" title="Manual pages">
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi<link rel="next" href="man.rndc-confgen.html" title="rndc-confgen">
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi<tr><th colspan="3" align="center"><code class="filename">rndc.conf</code></th></tr>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi<td width="20%" align="right">�<a accesskey="n" href="man.rndc-confgen.html">Next</a>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi<a name="man.rndc.conf"></a><div class="titlepage"></div>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi<p><code class="filename">rndc.conf</code> — rndc configuration file</p>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi<div class="cmdsynopsis"><p><code class="command">rndc.conf</code> </p></div>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi<p><code class="filename">rndc.conf</code> is the configuration file
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi for <span><strong class="command">rndc</strong></span>, the BIND 9 name server control
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi utility. This file has a similar structure and syntax to
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <code class="filename">named.conf</code>. Statements are enclosed
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi in braces and terminated with a semi-colon. Clauses in
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi the statements are also semi-colon terminated. The usual
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi comment styles are supported:
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi C style: /* */
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi C++ style: // to end of line
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi Unix style: # to end of line
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi<p><code class="filename">rndc.conf</code> is much simpler than
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <code class="filename">named.conf</code>. The file uses three
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi statements: an options statement, a server statement
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi and a key statement.
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi The <code class="option">options</code> statement contains five clauses.
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi The <code class="option">default-server</code> clause is followed by the
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi name or address of a name server. This host will be used when
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi no name server is given as an argument to
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <span><strong class="command">rndc</strong></span>. The <code class="option">default-key</code>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi clause is followed by the name of a key which is identified by
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <code class="option">keyid</code> is provided on the rndc command line,
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi and no <code class="option">key</code> clause is found in a matching
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <code class="option">server</code> statement, this default key will be
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi used to authenticate the server's commands and responses. The
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <code class="option">default-port</code> clause is followed by the port
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi to connect to on the remote name server. If no
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <code class="option">port</code> option is provided on the rndc command
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi line, and no <code class="option">port</code> clause is found in a
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi matching <code class="option">server</code> statement, this default port
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi will be used to connect.
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi The <code class="option">default-source-address</code> and
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <code class="option">default-source-address-v6</code> clauses which
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi can be used to set the IPv4 and IPv6 source addresses
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi respectively.
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi After the <code class="option">server</code> keyword, the server
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi statement includes a string which is the hostname or address
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi for a name server. The statement has three possible clauses:
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <code class="option">key</code>, <code class="option">port</code> and
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <code class="option">addresses</code>. The key name must match the
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi name of a key statement in the file. The port number
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi specifies the port to connect to. If an <code class="option">addresses</code>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi clause is supplied these addresses will be used instead of
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi the server name. Each address can take an optional port.
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi If an <code class="option">source-address</code> or <code class="option">source-address-v6</code>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi of supplied then these will be used to specify the IPv4 and IPv6
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi source addresses respectively.
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi The <code class="option">key</code> statement begins with an identifying
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi string, the name of the key. The statement has two clauses.
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <code class="option">algorithm</code> identifies the authentication algorithm
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi for <span><strong class="command">rndc</strong></span> to use; currently only HMAC-MD5
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi (for compatibility), HMAC-SHA1, HMAC-SHA224, HMAC-SHA256
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi (default), HMAC-SHA384 and HMAC-SHA512 are
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi supported. This is followed by a secret clause which contains
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi the base-64 encoding of the algorithm's authentication key. The
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi base-64 string is enclosed in double quotes.
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi There are two common ways to generate the base-64 string for the
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi secret. The BIND 9 program <span><strong class="command">rndc-confgen</strong></span>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi be used to generate a random key, or the
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <span><strong class="command">mmencode</strong></span> program, also known as
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <span><strong class="command">mimencode</strong></span>, can be used to generate a
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi string from known input. <span><strong class="command">mmencode</strong></span> does
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi ship with BIND 9 but is available on many systems. See the
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi EXAMPLE section for sample command lines for each.
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi default-server localhost;
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi default-key samplekey;
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi server localhost {
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi key samplekey;
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi server testserver {
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi key testkey;
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi addresses { localhost port 5353; };
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi key samplekey {
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi algorithm hmac-sha256;
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi secret "6FMfj43Osz4lyb24OIe2iGEz9lf1llJO+lz";
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi key testkey {
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi algorithm hmac-sha256;
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi secret "R3HI8P6BKw9ZwXwN3VZKuQ==";
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi In the above example, <span><strong class="command">rndc</strong></span> will by
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi default use
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi the server at localhost (127.0.0.1) and the key called samplekey.
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi Commands to the localhost server will use the samplekey key, which
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi must also be defined in the server's configuration file with the
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi same name and secret. The key statement indicates that samplekey
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi uses the HMAC-SHA256 algorithm and its secret clause contains the
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi base-64 encoding of the HMAC-SHA256 secret enclosed in double quotes.
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi If <span><strong class="command">rndc -s testserver</strong></span> is used then <span><strong class="command">rndc</strong></span> will
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi connect to server on localhost port 5353 using the key testkey.
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi To generate a random secret with <span><strong class="command">rndc-confgen</strong></span>:
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi<p><strong class="userinput"><code>rndc-confgen</code></strong>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi A complete <code class="filename">rndc.conf</code> file, including
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi randomly generated key, will be written to the standard
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi output. Commented-out <code class="option">key</code> and
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <code class="filename">named.conf</code> are also printed.
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi To generate a base-64 secret with <span><strong class="command">mmencode</strong></span>:
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi<p><strong class="userinput"><code>echo "known plaintext for a secret" | mmencode</code></strong>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi<a name="id2668064"></a><h2>NAME SERVER CONFIGURATION</h2>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi The name server must be configured to accept rndc connections and
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi to recognize the key specified in the <code class="filename">rndc.conf</code>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi file, using the controls statement in <code class="filename">named.conf</code>.
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi See the sections on the <code class="option">controls</code> statement in the
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi BIND 9 Administrator Reference Manual for details.
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi<p><span class="citerefentry"><span class="refentrytitle">rndc</span>(8)</span>,
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <span class="citerefentry"><span class="refentrytitle">rndc-confgen</span>(8)</span>,
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <span class="citerefentry"><span class="refentrytitle">mmencode</span>(1)</span>,
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <em class="citetitle">BIND 9 Administrator Reference Manual</em>.
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi<p><span class="corpauthor">Internet Systems Consortium</span>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi<td width="20%" align="center"><a accesskey="u" href="Bv9ARM.ch13.html">Up</a></td>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi<td width="40%" align="right">�<a accesskey="n" href="man.rndc-confgen.html">Next</a>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi<td width="20%" align="center"><a accesskey="h" href="Bv9ARM.html">Home</a></td>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi<td width="40%" align="right" valign="top">�<span class="application">rndc-confgen</span>
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi<p style="text-align: center;">BIND 9.11.0pre-alpha</p>