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