rndc.conf.docbook revision c651f15b30f1dae5cc2f00878fb5da5b3a35a468
94bd918b63001277f1b28ae4581645f8a835688fBob Halley<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews - Copyright (C) 2000, 2001 Internet Software Consortium.
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington - Permission to use, copy, modify, and distribute this software for any
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington - purpose with or without fee is hereby granted, provided that the above
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington - copyright notice and this permission notice appear in all copies.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - PERFORMANCE OF THIS SOFTWARE.
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<!-- $Id: rndc.conf.docbook,v 1.9 2005/04/07 03:49:59 marka Exp $ -->
94bd918b63001277f1b28ae4581645f8a835688fBob Halley <refentryinfo>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley </refentryinfo>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley <refentrytitle><filename>rndc.conf</filename></refentrytitle>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley <refnamediv>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley <refname><filename>rndc.conf</filename></refname>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley </refnamediv>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley <refsynopsisdiv>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley <cmdsynopsis>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley </cmdsynopsis>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley </refsynopsisdiv>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley <filename>rndc.conf</filename> is the configuration file
94bd918b63001277f1b28ae4581645f8a835688fBob Halley for <command>rndc</command>, the BIND 9 name server control
94bd918b63001277f1b28ae4581645f8a835688fBob Halley utility. This file has a similar structure and syntax to
94bd918b63001277f1b28ae4581645f8a835688fBob Halley <filename>named.conf</filename>. Statements are enclosed
94bd918b63001277f1b28ae4581645f8a835688fBob Halley in braces and terminated with a semi-colon. Clauses in
94bd918b63001277f1b28ae4581645f8a835688fBob Halley the statements are also semi-colon terminated. The usual
94bd918b63001277f1b28ae4581645f8a835688fBob Halley comment styles are supported:
94bd918b63001277f1b28ae4581645f8a835688fBob Halley C style: /* */
94bd918b63001277f1b28ae4581645f8a835688fBob Halley C++ style: // to end of line
94bd918b63001277f1b28ae4581645f8a835688fBob Halley Unix style: # to end of line
94bd918b63001277f1b28ae4581645f8a835688fBob Halley <filename>rndc.conf</filename> is much simpler than
94bd918b63001277f1b28ae4581645f8a835688fBob Halley <filename>named.conf</filename>. The file uses three
94bd918b63001277f1b28ae4581645f8a835688fBob Halley statements: an options statement, a server statement
94bd918b63001277f1b28ae4581645f8a835688fBob Halley and a key statement.
c4f9e613e12f03795bee18cf2ca8e6a9d39d6468Mark Andrews The <option>options</option> statement contains five clauses.
94bd918b63001277f1b28ae4581645f8a835688fBob Halley The <option>default-server</option> clause is followed by the
94bd918b63001277f1b28ae4581645f8a835688fBob Halley name or address of a name server. This host will be used when
94bd918b63001277f1b28ae4581645f8a835688fBob Halley no name server is given as an argument to
94bd918b63001277f1b28ae4581645f8a835688fBob Halley <command>rndc</command>. The <option>default-key</option>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley clause is followed by the name of a key which is identified by
94bd918b63001277f1b28ae4581645f8a835688fBob Halley <option>keyid</option> is provided on the rndc command line,
94bd918b63001277f1b28ae4581645f8a835688fBob Halley and no <option>key</option> clause is found in a matching
94bd918b63001277f1b28ae4581645f8a835688fBob Halley <option>server</option> statement, this default key will be
94bd918b63001277f1b28ae4581645f8a835688fBob Halley used to authenticate the server's commands and responses. The
94bd918b63001277f1b28ae4581645f8a835688fBob Halley <option>default-port</option> clause is followed by the port
94bd918b63001277f1b28ae4581645f8a835688fBob Halley to connect to on the remote name server. If no
94bd918b63001277f1b28ae4581645f8a835688fBob Halley <option>port</option> option is provided on the rndc command
94bd918b63001277f1b28ae4581645f8a835688fBob Halley line, and no <option>port</option> clause is found in a
94bd918b63001277f1b28ae4581645f8a835688fBob Halley matching <option>server</option> statement, this default port
94bd918b63001277f1b28ae4581645f8a835688fBob Halley will be used to connect.
c4f9e613e12f03795bee18cf2ca8e6a9d39d6468Mark Andrews The <option>default-source-address</option> and
c4f9e613e12f03795bee18cf2ca8e6a9d39d6468Mark Andrews <option>default-source-address-v6</option> clauses which
c4f9e613e12f03795bee18cf2ca8e6a9d39d6468Mark Andrews can be used to set the IPv4 and IPv6 source addresses
c4f9e613e12f03795bee18cf2ca8e6a9d39d6468Mark Andrews respectively.
7389e8330d62a059b8923fb8ca6f933caeb559d9Mark Andrews After the <option>server</option> keyword, the server
7389e8330d62a059b8923fb8ca6f933caeb559d9Mark Andrews statement includes a string which is the hostname or address
7389e8330d62a059b8923fb8ca6f933caeb559d9Mark Andrews for a name server. The statement has three possible clauses:
7389e8330d62a059b8923fb8ca6f933caeb559d9Mark Andrews <option>key</option>, <option>port</option> and
7389e8330d62a059b8923fb8ca6f933caeb559d9Mark Andrews <option>addresses</option>. The key name must match the
7389e8330d62a059b8923fb8ca6f933caeb559d9Mark Andrews name of a key statement in the file. The port number
7389e8330d62a059b8923fb8ca6f933caeb559d9Mark Andrews specifies the port to connect to. If an <option>addresses</option>
7389e8330d62a059b8923fb8ca6f933caeb559d9Mark Andrews clause is supplied these addresses will be used instead of
7389e8330d62a059b8923fb8ca6f933caeb559d9Mark Andrews the server name. Each address can take a optional port.
c4f9e613e12f03795bee18cf2ca8e6a9d39d6468Mark Andrews If an <option>source-address</option> or <option>source-address-v6</option>
c4f9e613e12f03795bee18cf2ca8e6a9d39d6468Mark Andrews of supplied then these will be used to specify the IPv4 and IPv6
c4f9e613e12f03795bee18cf2ca8e6a9d39d6468Mark Andrews source addresses respectively.
94bd918b63001277f1b28ae4581645f8a835688fBob Halley The <option>key</option> statement begins with an identifying
94bd918b63001277f1b28ae4581645f8a835688fBob Halley string, the name of the key. The statement has two clauses.
94bd918b63001277f1b28ae4581645f8a835688fBob Halley <option>algorithm</option> identifies the encryption algorithm
94bd918b63001277f1b28ae4581645f8a835688fBob Halley for <command>rndc</command> to use; currently only HMAC-MD5 is
94bd918b63001277f1b28ae4581645f8a835688fBob Halley supported. This is followed by a secret clause which contains
94bd918b63001277f1b28ae4581645f8a835688fBob Halley the base-64 encoding of the algorithm's encryption key. The
94bd918b63001277f1b28ae4581645f8a835688fBob Halley base-64 string is enclosed in double quotes.
94bd918b63001277f1b28ae4581645f8a835688fBob Halley There are two common ways to generate the base-64 string for the
f8644da8d948dbc973f6dd4c94a79774e16ec07bDavid Lawrence secret. The BIND 9 program <command>rndc-confgen</command> can
94bd918b63001277f1b28ae4581645f8a835688fBob Halley be used to generate a random key, or the
94bd918b63001277f1b28ae4581645f8a835688fBob Halley <command>mmencode</command> program, also known as
94bd918b63001277f1b28ae4581645f8a835688fBob Halley <command>mimencode</command>, can be used to generate a base-64
94bd918b63001277f1b28ae4581645f8a835688fBob Halley string from known input. <command>mmencode</command> does not
94bd918b63001277f1b28ae4581645f8a835688fBob Halley ship with BIND 9 but is available on many systems. See the
94bd918b63001277f1b28ae4581645f8a835688fBob Halley EXAMPLE section for sample command lines for each.
94bd918b63001277f1b28ae4581645f8a835688fBob Halley <programlisting>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley default-server localhost;
94bd918b63001277f1b28ae4581645f8a835688fBob Halley default-key samplekey;
94bd918b63001277f1b28ae4581645f8a835688fBob Halley server localhost {
94bd918b63001277f1b28ae4581645f8a835688fBob Halley key samplekey;
7389e8330d62a059b8923fb8ca6f933caeb559d9Mark Andrews server testserver {
7389e8330d62a059b8923fb8ca6f933caeb559d9Mark Andrews key testkey;
7389e8330d62a059b8923fb8ca6f933caeb559d9Mark Andrews addresses { localhost port 5353; };
94bd918b63001277f1b28ae4581645f8a835688fBob Halley key samplekey {
94bd918b63001277f1b28ae4581645f8a835688fBob Halley algorithm hmac-md5;
7389e8330d62a059b8923fb8ca6f933caeb559d9Mark Andrews secret "6FMfj43Osz4lyb24OIe2iGEz9lf1llJO+lz";
7389e8330d62a059b8923fb8ca6f933caeb559d9Mark Andrews key testkey {
7389e8330d62a059b8923fb8ca6f933caeb559d9Mark Andrews algorithm hmac-md5;
7389e8330d62a059b8923fb8ca6f933caeb559d9Mark Andrews secret "R3HI8P6BKw9ZwXwN3VZKuQ==";
94bd918b63001277f1b28ae4581645f8a835688fBob Halley </programlisting>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley In the above example, <command>rndc</command> will by default use
94bd918b63001277f1b28ae4581645f8a835688fBob Halley the server at localhost (127.0.0.1) and the key called samplekey.
94bd918b63001277f1b28ae4581645f8a835688fBob Halley Commands to the localhost server will use the samplekey key, which
94bd918b63001277f1b28ae4581645f8a835688fBob Halley must also be defined in the server's configuration file with the
94bd918b63001277f1b28ae4581645f8a835688fBob Halley same name and secret. The key statement indicates that samplekey
94bd918b63001277f1b28ae4581645f8a835688fBob Halley uses the HMAC-MD5 algorithm and its secret clause contains the
94bd918b63001277f1b28ae4581645f8a835688fBob Halley base-64 encoding of the HMAC-MD5 secret enclosed in double quotes.
7389e8330d62a059b8923fb8ca6f933caeb559d9Mark Andrews If <command>rndc -s testserver</command> is used then <command>rndc</command> will
7389e8330d62a059b8923fb8ca6f933caeb559d9Mark Andrews connect to server on localhost port 5353 using the key testkey.
f8644da8d948dbc973f6dd4c94a79774e16ec07bDavid Lawrence To generate a random secret with <command>rndc-confgen</command>:
f8644da8d948dbc973f6dd4c94a79774e16ec07bDavid Lawrence A complete <filename>rndc.conf</filename> file, including the
f8644da8d948dbc973f6dd4c94a79774e16ec07bDavid Lawrence randomly generated key, will be written to the standard
f8644da8d948dbc973f6dd4c94a79774e16ec07bDavid Lawrence output. Commented out <option>key</option> and
f8644da8d948dbc973f6dd4c94a79774e16ec07bDavid Lawrence <filename>named.conf</filename> are also printed.
f8644da8d948dbc973f6dd4c94a79774e16ec07bDavid Lawrence To generate a base-64 secret with <command>mmencode</command>:
f8644da8d948dbc973f6dd4c94a79774e16ec07bDavid Lawrence <userinput>echo "known plaintext for a secret" | mmencode</userinput>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley The name server must be configured to accept rndc connections and
94bd918b63001277f1b28ae4581645f8a835688fBob Halley to recognize the key specified in the <filename>rndc.conf</filename>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley file, using the controls statement in <filename>named.conf</filename>.
94bd918b63001277f1b28ae4581645f8a835688fBob Halley See the sections on the <option>controls</option> statement in the
94bd918b63001277f1b28ae4581645f8a835688fBob Halley BIND 9 Administrator Reference Manual for details.
94bd918b63001277f1b28ae4581645f8a835688fBob Halley <citerefentry>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley </citerefentry>,
94bd918b63001277f1b28ae4581645f8a835688fBob Halley <citerefentry>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley </citerefentry>,
94bd918b63001277f1b28ae4581645f8a835688fBob Halley <citerefentry>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley </citerefentry>,
94bd918b63001277f1b28ae4581645f8a835688fBob Halley <citetitle>BIND 9 Administrator Reference Manual</citetitle>.
17cb8353e999e3294e6619613f401af3f7b1540cMark Andrews <corpauthor>Internet Systems Consortium</corpauthor>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley - Local variables:
94bd918b63001277f1b28ae4581645f8a835688fBob Halley - mode: sgml