Merge from vendor branch BZIP:
[dragonfly.git] / contrib / bind-9.3 / bin / rndc / rndc.conf.html
1 <!--
2  - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
3  - Copyright (C) 2000, 2001 Internet Software Consortium.
4  - 
5  - Permission to use, copy, modify, and distribute this software for any
6  - purpose with or without fee is hereby granted, provided that the above
7  - copyright notice and this permission notice appear in all copies.
8  - 
9  - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10  - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11  - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12  - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13  - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14  - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15  - PERFORMANCE OF THIS SOFTWARE.
16 -->
17 <!-- $Id: rndc.conf.html,v 1.5.2.1.4.13 2006/06/29 13:02:31 marka Exp $ -->
18 <html>
19 <head>
20 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
21 <title>rndc.conf</title>
22 <meta name="generator" content="DocBook XSL Stylesheets V1.70.1">
23 </head>
24 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
25 <a name="id2482688"></a><div class="titlepage"></div>
26 <div class="refnamediv">
27 <h2>Name</h2>
28 <p><code class="filename">rndc.conf</code> &#8212; rndc configuration file</p>
29 </div>
30 <div class="refsynopsisdiv">
31 <h2>Synopsis</h2>
32 <div class="cmdsynopsis"><p><code class="command">rndc.conf</code> </p></div>
33 </div>
34 <div class="refsect1" lang="en">
35 <a name="id2549398"></a><h2>DESCRIPTION</h2>
36 <p>
37         <code class="filename">rndc.conf</code> is the configuration file
38         for <span><strong class="command">rndc</strong></span>, the BIND 9 name server control
39         utility.  This file has a similar structure and syntax to
40         <code class="filename">named.conf</code>.  Statements are enclosed
41         in braces and terminated with a semi-colon.  Clauses in
42         the statements are also semi-colon terminated.  The usual
43         comment styles are supported:
44     </p>
45 <p>
46         C style: /* */
47     </p>
48 <p>
49         C++ style: // to end of line
50     </p>
51 <p>
52         Unix style: # to end of line
53     </p>
54 <p>
55         <code class="filename">rndc.conf</code> is much simpler than
56         <code class="filename">named.conf</code>.  The file uses three
57         statements: an options statement, a server statement
58         and a key statement.
59     </p>
60 <p>
61         The <code class="option">options</code> statement contains three clauses.
62         The <code class="option">default-server</code> clause is followed by the
63         name or address of a name server.  This host will be used when
64         no name server is given as an argument to
65         <span><strong class="command">rndc</strong></span>.  The <code class="option">default-key</code>
66         clause is followed by the name of a key which is identified by
67         a <code class="option">key</code> statement.  If no
68         <code class="option">keyid</code> is provided on the rndc command line,
69         and no <code class="option">key</code> clause is found in a matching
70         <code class="option">server</code> statement, this default key will be
71         used to authenticate the server's commands and responses.  The
72         <code class="option">default-port</code> clause is followed by the port
73         to connect to on the remote name server.  If no
74         <code class="option">port</code> option is provided on the rndc command
75         line, and no <code class="option">port</code> clause is found in a
76         matching <code class="option">server</code> statement, this default port
77         will be used to connect.
78     </p>
79 <p>
80         After the <code class="option">server</code> keyword, the server statement
81         includes a string which is the hostname or address for a name
82         server.  The statement has two possible clauses:
83         <code class="option">key</code> and <code class="option">port</code>. The key name must
84         match the name of a key statement in the file.  The port number
85         specifies the port to connect to.
86     </p>
87 <p>
88         The <code class="option">key</code> statement begins with an identifying
89         string, the name of the key.  The statement has two clauses.
90         <code class="option">algorithm</code> identifies the encryption algorithm
91         for <span><strong class="command">rndc</strong></span> to use; currently only HMAC-MD5 is
92         supported.  This is followed by a secret clause which contains
93         the base-64 encoding of the algorithm's encryption key.  The
94         base-64 string is enclosed in double quotes.
95     </p>
96 <p>
97         There are two common ways to generate the base-64 string for the
98         secret.  The BIND 9 program <span><strong class="command">rndc-confgen</strong></span> can
99         be used to generate a random key, or the
100         <span><strong class="command">mmencode</strong></span> program, also known as
101         <span><strong class="command">mimencode</strong></span>, can be used to generate a base-64
102         string from known input.  <span><strong class="command">mmencode</strong></span> does not
103         ship with BIND 9 but is available on many systems.  See the
104         EXAMPLE section for sample command lines for each.
105     </p>
106 </div>
107 <div class="refsect1" lang="en">
108 <a name="id2549601"></a><h2>EXAMPLE</h2>
109 <pre class="programlisting">
110     options {
111         default-server  localhost;
112         default-key     samplekey;
113       };
114
115       server localhost {
116         key             samplekey;
117       };
118
119       key samplekey {
120         algorithm       hmac-md5;
121         secret          "c3Ryb25nIGVub3VnaCBmb3IgYSBtYW4gYnV0IG1hZGUgZm9yIGEgd29tYW4K";
122       };
123     </pre>
124 <p>
125         In the above example, <span><strong class="command">rndc</strong></span> will by default use
126         the server at localhost (127.0.0.1) and the key called samplekey.
127         Commands to the localhost server will use the samplekey key, which
128         must also be defined in the server's configuration file with the
129         same name and secret.  The key statement indicates that samplekey
130         uses the HMAC-MD5 algorithm and its secret clause contains the
131         base-64 encoding of the HMAC-MD5 secret enclosed in double quotes.
132     </p>
133 <p>
134         To generate a random secret with <span><strong class="command">rndc-confgen</strong></span>:
135     </p>
136 <p>
137         <strong class="userinput"><code>rndc-confgen</code></strong>
138     </p>
139 <p>
140         A complete <code class="filename">rndc.conf</code> file, including the
141         randomly generated key, will be written to the standard
142         output.  Commented out <code class="option">key</code> and
143         <code class="option">controls</code> statements for
144         <code class="filename">named.conf</code> are also printed.
145     </p>
146 <p>
147         To generate a base-64 secret with <span><strong class="command">mmencode</strong></span>:
148     </p>
149 <p>
150         <strong class="userinput"><code>echo "known plaintext for a secret" | mmencode</code></strong>
151     </p>
152 </div>
153 <div class="refsect1" lang="en">
154 <a name="id2549730"></a><h2>NAME SERVER CONFIGURATION</h2>
155 <p>
156         The name server must be configured to accept rndc connections and
157         to recognize the key specified in the <code class="filename">rndc.conf</code>
158         file, using the controls statement in <code class="filename">named.conf</code>.
159         See the sections on the <code class="option">controls</code> statement in the
160         BIND 9 Administrator Reference Manual for details.
161     </p>
162 </div>
163 <div class="refsect1" lang="en">
164 <a name="id2549750"></a><h2>SEE ALSO</h2>
165 <p>
166       <span class="citerefentry"><span class="refentrytitle">rndc</span>(8)</span>,
167       <span class="citerefentry"><span class="refentrytitle">rndc-confgen</span>(8)</span>,
168       <span class="citerefentry"><span class="refentrytitle">mmencode</span>(1)</span>,
169       <em class="citetitle">BIND 9 Administrator Reference Manual</em>.
170     </p>
171 </div>
172 <div class="refsect1" lang="en">
173 <a name="id2549793"></a><h2>AUTHOR</h2>
174 <p>
175         <span class="corpauthor">Internet Systems Consortium</span>
176     </p>
177 </div>
178 </div></body>
179 </html>