]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/blob - contrib/bind9/bin/rndc/rndc.conf.docbook
MFV r306384:
[FreeBSD/stable/9.git] / contrib / bind9 / bin / rndc / rndc.conf.docbook
1 <!--
2  - Copyright (C) 2004, 2005, 2007, 2014, 2015  Internet Systems Consortium, Inc. ("ISC")
3  - Copyright (C) 2000, 2001  Internet Software Consortium.
4  -
5  - Permission to use, copy, modify, and/or 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
18 <!-- Converted by db4-upgrade version 1.0 -->
19 <refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="man.rndc.conf">
20   <info>
21     <date>2007-06-18</date>
22   </info>
23   <refentryinfo>
24     <corpname>ISC</corpname>
25     <corpauthor>Internet Systems Consortium, Inc.</corpauthor>
26   </refentryinfo>
27
28   <refmeta>
29     <refentrytitle><filename>rndc.conf</filename></refentrytitle>
30     <manvolnum>5</manvolnum>
31     <refmiscinfo>BIND9</refmiscinfo>
32   </refmeta>
33
34   <refnamediv>
35     <refname><filename>rndc.conf</filename></refname>
36     <refpurpose>rndc configuration file</refpurpose>
37   </refnamediv>
38
39   <docinfo>
40     <copyright>
41       <year>2004</year>
42       <year>2005</year>
43       <year>2007</year>
44       <year>2014</year>
45       <year>2015</year>
46       <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
47     </copyright>
48     <copyright>
49       <year>2000</year>
50       <year>2001</year>
51       <holder>Internet Software Consortium.</holder>
52     </copyright>
53   </docinfo>
54
55   <refsynopsisdiv>
56     <cmdsynopsis sepchar=" ">
57       <command>rndc.conf</command>
58     </cmdsynopsis>
59   </refsynopsisdiv>
60
61   <refsection><info><title>DESCRIPTION</title></info>
62
63     <para><filename>rndc.conf</filename> is the configuration file
64       for <command>rndc</command>, the BIND 9 name server control
65       utility.  This file has a similar structure and syntax to
66       <filename>named.conf</filename>.  Statements are enclosed
67       in braces and terminated with a semi-colon.  Clauses in
68       the statements are also semi-colon terminated.  The usual
69       comment styles are supported:
70     </para>
71     <para>
72       C style: /* */
73     </para>
74     <para>
75       C++ style: // to end of line
76     </para>
77     <para>
78       Unix style: # to end of line
79     </para>
80     <para><filename>rndc.conf</filename> is much simpler than
81       <filename>named.conf</filename>.  The file uses three
82       statements: an options statement, a server statement
83       and a key statement.
84     </para>
85     <para>
86       The <option>options</option> statement contains five clauses.
87       The <option>default-server</option> clause is followed by the
88       name or address of a name server.  This host will be used when
89       no name server is given as an argument to
90       <command>rndc</command>.  The <option>default-key</option>
91       clause is followed by the name of a key which is identified by
92       a <option>key</option> statement.  If no
93       <option>keyid</option> is provided on the rndc command line,
94       and no <option>key</option> clause is found in a matching
95       <option>server</option> statement, this default key will be
96       used to authenticate the server's commands and responses.  The
97       <option>default-port</option> clause is followed by the port
98       to connect to on the remote name server.  If no
99       <option>port</option> option is provided on the rndc command
100       line, and no <option>port</option> clause is found in a
101       matching <option>server</option> statement, this default port
102       will be used to connect.
103       The <option>default-source-address</option> and
104       <option>default-source-address-v6</option> clauses which
105       can be used to set the IPv4 and IPv6 source addresses
106       respectively.
107     </para>
108     <para>
109       After the <option>server</option> keyword, the server
110       statement includes a string which is the hostname or address
111       for a name server.  The statement has three possible clauses:
112       <option>key</option>, <option>port</option> and
113       <option>addresses</option>. The key name must match the
114       name of a key statement in the file.  The port number
115       specifies the port to connect to.  If an <option>addresses</option>
116       clause is supplied these addresses will be used instead of
117       the server name.  Each address can take an optional port.
118       If an <option>source-address</option> or <option>source-address-v6</option>
119       of supplied then these will be used to specify the IPv4 and IPv6
120       source addresses respectively.
121     </para>
122     <para>
123       The <option>key</option> statement begins with an identifying
124       string, the name of the key.  The statement has two clauses.
125       <option>algorithm</option> identifies the encryption algorithm
126       for <command>rndc</command> to use; currently only HMAC-MD5
127       is
128       supported.  This is followed by a secret clause which contains
129       the base-64 encoding of the algorithm's encryption key.  The
130       base-64 string is enclosed in double quotes.
131     </para>
132     <para>
133       There are two common ways to generate the base-64 string for the
134       secret.  The BIND 9 program <command>rndc-confgen</command>
135       can
136       be used to generate a random key, or the
137       <command>mmencode</command> program, also known as
138       <command>mimencode</command>, can be used to generate a
139       base-64
140       string from known input.  <command>mmencode</command> does
141       not
142       ship with BIND 9 but is available on many systems.  See the
143       EXAMPLE section for sample command lines for each.
144     </para>
145   </refsection>
146
147   <refsection><info><title>EXAMPLE</title></info>
148
149
150     <para><programlisting>
151       options {
152         default-server  localhost;
153         default-key     samplekey;
154       };
155 </programlisting>
156     </para>
157     <para><programlisting>
158       server localhost {
159         key             samplekey;
160       };
161 </programlisting>
162     </para>
163     <para><programlisting>
164       server testserver {
165         key             testkey;
166         addresses       { localhost port 5353; };
167       };
168 </programlisting>
169     </para>
170     <para><programlisting>
171       key samplekey {
172         algorithm       hmac-md5;
173         secret          "6FMfj43Osz4lyb24OIe2iGEz9lf1llJO+lz";
174       };
175 </programlisting>
176     </para>
177     <para><programlisting>
178       key testkey {
179         algorithm       hmac-md5;
180         secret          "R3HI8P6BKw9ZwXwN3VZKuQ==";
181       };
182     </programlisting>
183     </para>
184
185     <para>
186       In the above example, <command>rndc</command> will by
187       default use
188       the server at localhost (127.0.0.1) and the key called samplekey.
189       Commands to the localhost server will use the samplekey key, which
190       must also be defined in the server's configuration file with the
191       same name and secret.  The key statement indicates that samplekey
192       uses the HMAC-MD5 algorithm and its secret clause contains the
193       base-64 encoding of the HMAC-MD5 secret enclosed in double quotes.
194     </para>
195     <para>
196       If <command>rndc -s testserver</command> is used then <command>rndc</command> will
197       connect to server on localhost port 5353 using the key testkey.
198     </para>
199     <para>
200       To generate a random secret with <command>rndc-confgen</command>:
201     </para>
202     <para><userinput>rndc-confgen</userinput>
203     </para>
204     <para>
205       A complete <filename>rndc.conf</filename> file, including
206       the
207       randomly generated key, will be written to the standard
208       output.  Commented-out <option>key</option> and
209       <option>controls</option> statements for
210       <filename>named.conf</filename> are also printed.
211     </para>
212     <para>
213       To generate a base-64 secret with <command>mmencode</command>:
214     </para>
215     <para><userinput>echo "known plaintext for a secret" | mmencode</userinput>
216     </para>
217   </refsection>
218
219   <refsection><info><title>NAME SERVER CONFIGURATION</title></info>
220
221     <para>
222       The name server must be configured to accept rndc connections and
223       to recognize the key specified in the <filename>rndc.conf</filename>
224       file, using the controls statement in <filename>named.conf</filename>.
225       See the sections on the <option>controls</option> statement in the
226       BIND 9 Administrator Reference Manual for details.
227     </para>
228   </refsection>
229
230   <refsection><info><title>SEE ALSO</title></info>
231
232     <para><citerefentry>
233         <refentrytitle>rndc</refentrytitle><manvolnum>8</manvolnum>
234       </citerefentry>,
235       <citerefentry>
236         <refentrytitle>rndc-confgen</refentrytitle><manvolnum>8</manvolnum>
237       </citerefentry>,
238       <citerefentry>
239         <refentrytitle>mmencode</refentrytitle><manvolnum>1</manvolnum>
240       </citerefentry>,
241       <citetitle>BIND 9 Administrator Reference Manual</citetitle>.
242     </para>
243   </refsection>
244
245 </refentry>