rndc.conf.docbook revision 94bd918b63001277f1b28ae4581645f8a835688f
94bd918b63001277f1b28ae4581645f8a835688fBob Halley<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
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.
94bd918b63001277f1b28ae4581645f8a835688fBob Halley The <option>options</option> statement contains three 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.
94bd918b63001277f1b28ae4581645f8a835688fBob Halley After the <option>server</option> keyword, the server statement
94bd918b63001277f1b28ae4581645f8a835688fBob Halley includes a string which is the hostname or address for a name
94bd918b63001277f1b28ae4581645f8a835688fBob Halley server. The statement has two possible clauses:
94bd918b63001277f1b28ae4581645f8a835688fBob Halley <option>key</option> and <option>port</option>. The key name must
94bd918b63001277f1b28ae4581645f8a835688fBob Halley match the name of a key statement in the file. The port number
94bd918b63001277f1b28ae4581645f8a835688fBob Halley specifies the port to connect to.
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
94bd918b63001277f1b28ae4581645f8a835688fBob Halley secret. The BIND 9 program <command>dnssec-keygen</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;
94bd918b63001277f1b28ae4581645f8a835688fBob Halley key samplekey {
94bd918b63001277f1b28ae4581645f8a835688fBob Halley algorithm hmac-md5;
94bd918b63001277f1b28ae4581645f8a835688fBob Halley secret "c3Ryb25nIGVub3VnaCBmb3IgYSBtYW4gYnV0IG1hZGUgZm9yIGEgd29tYW4K";
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.
94bd918b63001277f1b28ae4581645f8a835688fBob Halley To generate a random secret with <command>dnssec-keygen</command>:
94bd918b63001277f1b28ae4581645f8a835688fBob Halley <userinput>$ dnssec-keygen -a hmac-md5 -b 128 -n user rndc</userinput>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley The base-64 string will appear in two files,
94bd918b63001277f1b28ae4581645f8a835688fBob Halley <filename>Krndc.+157.+{random}.key</filename> and
94bd918b63001277f1b28ae4581645f8a835688fBob Halley <filename>Krndc.+157.+{random}.private</filename>. After
94bd918b63001277f1b28ae4581645f8a835688fBob Halley extracting the key to be placed in the
94bd918b63001277f1b28ae4581645f8a835688fBob Halley <filename>named.conf</filename> key statements, the
94bd918b63001277f1b28ae4581645f8a835688fBob Halley .key and .private files can be removed.
94bd918b63001277f1b28ae4581645f8a835688fBob Halley To generate a random secret with <command>mmencode</command>:
94bd918b63001277f1b28ae4581645f8a835688fBob Halley <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>.
94bd918b63001277f1b28ae4581645f8a835688fBob Halley <corpauthor>Internet Software Consortium</corpauthor>
94bd918b63001277f1b28ae4581645f8a835688fBob Halley - Local variables:
94bd918b63001277f1b28ae4581645f8a835688fBob Halley - mode: sgml