]> CyberLeo.Net >> Repos - FreeBSD/releng/7.2.git/blob - contrib/bind9/bin/nsupdate/nsupdate.html
Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.
[FreeBSD/releng/7.2.git] / contrib / bind9 / bin / nsupdate / nsupdate.html
1 <!--
2  - Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
3  - Copyright (C) 2000-2003 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: nsupdate.html,v 1.14.18.23 2008/09/01 02:29:00 tbox Exp $ -->
18 <html>
19 <head>
20 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
21 <title>nsupdate</title>
22 <meta name="generator" content="DocBook XSL Stylesheets V1.71.1">
23 </head>
24 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
25 <a name="id2476275"></a><div class="titlepage"></div>
26 <div class="refnamediv">
27 <h2>Name</h2>
28 <p>nsupdate &#8212; Dynamic DNS update utility</p>
29 </div>
30 <div class="refsynopsisdiv">
31 <h2>Synopsis</h2>
32 <div class="cmdsynopsis"><p><code class="command">nsupdate</code>  [<code class="option">-d</code>] [[<code class="option">-y <em class="replaceable"><code>[<span class="optional">hmac:</span>]keyname:secret</code></em></code>] |  [<code class="option">-k <em class="replaceable"><code>keyfile</code></em></code>]] [<code class="option">-t <em class="replaceable"><code>timeout</code></em></code>] [<code class="option">-u <em class="replaceable"><code>udptimeout</code></em></code>] [<code class="option">-r <em class="replaceable"><code>udpretries</code></em></code>] [<code class="option">-v</code>] [filename]</p></div>
33 </div>
34 <div class="refsect1" lang="en">
35 <a name="id2543420"></a><h2>DESCRIPTION</h2>
36 <p><span><strong class="command">nsupdate</strong></span>
37       is used to submit Dynamic DNS Update requests as defined in RFC2136
38       to a name server.
39       This allows resource records to be added or removed from a zone
40       without manually editing the zone file.
41       A single update request can contain requests to add or remove more than
42       one
43       resource record.
44     </p>
45 <p>
46       Zones that are under dynamic control via
47       <span><strong class="command">nsupdate</strong></span>
48       or a DHCP server should not be edited by hand.
49       Manual edits could
50       conflict with dynamic updates and cause data to be lost.
51     </p>
52 <p>
53       The resource records that are dynamically added or removed with
54       <span><strong class="command">nsupdate</strong></span>
55       have to be in the same zone.
56       Requests are sent to the zone's master server.
57       This is identified by the MNAME field of the zone's SOA record.
58     </p>
59 <p>
60       The
61       <code class="option">-d</code>
62       option makes
63       <span><strong class="command">nsupdate</strong></span>
64       operate in debug mode.
65       This provides tracing information about the update requests that are
66       made and the replies received from the name server.
67     </p>
68 <p>
69       Transaction signatures can be used to authenticate the Dynamic DNS
70       updates.
71       These use the TSIG resource record type described in RFC2845 or the
72       SIG(0) record described in RFC3535 and RFC2931.
73       TSIG relies on a shared secret that should only be known to
74       <span><strong class="command">nsupdate</strong></span> and the name server.
75       Currently, the only supported encryption algorithm for TSIG is
76       HMAC-MD5, which is defined in RFC 2104.
77       Once other algorithms are defined for TSIG, applications will need to
78       ensure they select the appropriate algorithm as well as the key when
79       authenticating each other.
80       For instance, suitable
81       <span class="type">key</span>
82       and
83       <span class="type">server</span>
84       statements would be added to
85       <code class="filename">/etc/named.conf</code>
86       so that the name server can associate the appropriate secret key
87       and algorithm with the IP address of the
88       client application that will be using TSIG authentication.
89       SIG(0) uses public key cryptography.  To use a SIG(0) key, the public
90       key must be stored in a KEY record in a zone served by the name server.
91       <span><strong class="command">nsupdate</strong></span>
92       does not read
93       <code class="filename">/etc/named.conf</code>.
94     </p>
95 <p><span><strong class="command">nsupdate</strong></span>
96       uses the <code class="option">-y</code> or <code class="option">-k</code> option
97       to provide the shared secret needed to generate a TSIG record
98       for authenticating Dynamic DNS update requests, default type
99       HMAC-MD5.  These options are mutually exclusive.  With the
100       <code class="option">-k</code> option, <span><strong class="command">nsupdate</strong></span> reads
101       the shared secret from the file <em class="parameter"><code>keyfile</code></em>,
102       whose name is of the form
103       <code class="filename">K{name}.+157.+{random}.private</code>.  For
104       historical reasons, the file
105       <code class="filename">K{name}.+157.+{random}.key</code> must also be
106       present.  When the <code class="option">-y</code> option is used, a
107       signature is generated from
108       [<span class="optional"><em class="parameter"><code>hmac:</code></em></span>]<em class="parameter"><code>keyname:secret.</code></em>
109       <em class="parameter"><code>keyname</code></em> is the name of the key, and
110       <em class="parameter"><code>secret</code></em> is the base64 encoded shared
111       secret.  Use of the <code class="option">-y</code> option is discouraged
112       because the shared secret is supplied as a command line
113       argument in clear text.  This may be visible in the output
114       from
115       <span class="citerefentry"><span class="refentrytitle">ps</span>(1)</span> or in a history file maintained by the user's
116       shell.
117     </p>
118 <p>
119       The <code class="option">-k</code> may also be used to specify a SIG(0) key used
120       to authenticate Dynamic DNS update requests.  In this case, the key
121       specified is not an HMAC-MD5 key.
122     </p>
123 <p>
124       By default
125       <span><strong class="command">nsupdate</strong></span>
126       uses UDP to send update requests to the name server unless they are too
127       large to fit in a UDP request in which case TCP will be used.
128       The
129       <code class="option">-v</code>
130       option makes
131       <span><strong class="command">nsupdate</strong></span>
132       use a TCP connection.
133       This may be preferable when a batch of update requests is made.
134     </p>
135 <p>
136       The <code class="option">-t</code> option sets the maximum time an update request
137       can
138       take before it is aborted.  The default is 300 seconds.  Zero can be
139       used
140       to disable the timeout.
141     </p>
142 <p>
143       The <code class="option">-u</code> option sets the UDP retry interval.  The default
144       is
145       3 seconds.  If zero, the interval will be computed from the timeout
146       interval
147       and number of UDP retries.
148     </p>
149 <p>
150       The <code class="option">-r</code> option sets the number of UDP retries. The
151       default is
152       3.  If zero, only one update request will be made.
153     </p>
154 </div>
155 <div class="refsect1" lang="en">
156 <a name="id2543649"></a><h2>INPUT FORMAT</h2>
157 <p><span><strong class="command">nsupdate</strong></span>
158       reads input from
159       <em class="parameter"><code>filename</code></em>
160       or standard input.
161       Each command is supplied on exactly one line of input.
162       Some commands are for administrative purposes.
163       The others are either update instructions or prerequisite checks on the
164       contents of the zone.
165       These checks set conditions that some name or set of
166       resource records (RRset) either exists or is absent from the zone.
167       These conditions must be met if the entire update request is to succeed.
168       Updates will be rejected if the tests for the prerequisite conditions
169       fail.
170     </p>
171 <p>
172       Every update request consists of zero or more prerequisites
173       and zero or more updates.
174       This allows a suitably authenticated update request to proceed if some
175       specified resource records are present or missing from the zone.
176       A blank input line (or the <span><strong class="command">send</strong></span> command)
177       causes the
178       accumulated commands to be sent as one Dynamic DNS update request to the
179       name server.
180     </p>
181 <p>
182       The command formats and their meaning are as follows:
183       </p>
184 <div class="variablelist"><dl>
185 <dt><span class="term">
186               <span><strong class="command">server</strong></span>
187                {servername}
188                [port]
189             </span></dt>
190 <dd><p>
191               Sends all dynamic update requests to the name server
192               <em class="parameter"><code>servername</code></em>.
193               When no server statement is provided,
194               <span><strong class="command">nsupdate</strong></span>
195               will send updates to the master server of the correct zone.
196               The MNAME field of that zone's SOA record will identify the
197               master
198               server for that zone.
199               <em class="parameter"><code>port</code></em>
200               is the port number on
201               <em class="parameter"><code>servername</code></em>
202               where the dynamic update requests get sent.
203               If no port number is specified, the default DNS port number of
204               53 is
205               used.
206             </p></dd>
207 <dt><span class="term">
208               <span><strong class="command">local</strong></span>
209                {address}
210                [port]
211             </span></dt>
212 <dd><p>
213               Sends all dynamic update requests using the local
214               <em class="parameter"><code>address</code></em>.
215
216               When no local statement is provided,
217               <span><strong class="command">nsupdate</strong></span>
218               will send updates using an address and port chosen by the
219               system.
220               <em class="parameter"><code>port</code></em>
221               can additionally be used to make requests come from a specific
222               port.
223               If no port number is specified, the system will assign one.
224             </p></dd>
225 <dt><span class="term">
226               <span><strong class="command">zone</strong></span>
227                {zonename}
228             </span></dt>
229 <dd><p>
230               Specifies that all updates are to be made to the zone
231               <em class="parameter"><code>zonename</code></em>.
232               If no
233               <em class="parameter"><code>zone</code></em>
234               statement is provided,
235               <span><strong class="command">nsupdate</strong></span>
236               will attempt determine the correct zone to update based on the
237               rest of the input.
238             </p></dd>
239 <dt><span class="term">
240               <span><strong class="command">class</strong></span>
241                {classname}
242             </span></dt>
243 <dd><p>
244               Specify the default class.
245               If no <em class="parameter"><code>class</code></em> is specified, the
246               default class is
247               <em class="parameter"><code>IN</code></em>.
248             </p></dd>
249 <dt><span class="term">
250               <span><strong class="command">key</strong></span>
251                {name}
252                {secret}
253             </span></dt>
254 <dd><p>
255               Specifies that all updates are to be TSIG-signed using the
256               <em class="parameter"><code>keyname</code></em> <em class="parameter"><code>keysecret</code></em> pair.
257               The <span><strong class="command">key</strong></span> command
258               overrides any key specified on the command line via
259               <code class="option">-y</code> or <code class="option">-k</code>.
260             </p></dd>
261 <dt><span class="term">
262               <span><strong class="command">prereq nxdomain</strong></span>
263                {domain-name}
264             </span></dt>
265 <dd><p>
266               Requires that no resource record of any type exists with name
267               <em class="parameter"><code>domain-name</code></em>.
268             </p></dd>
269 <dt><span class="term">
270               <span><strong class="command">prereq yxdomain</strong></span>
271                {domain-name}
272             </span></dt>
273 <dd><p>
274               Requires that
275               <em class="parameter"><code>domain-name</code></em>
276               exists (has as at least one resource record, of any type).
277             </p></dd>
278 <dt><span class="term">
279               <span><strong class="command">prereq nxrrset</strong></span>
280                {domain-name}
281                [class]
282                {type}
283             </span></dt>
284 <dd><p>
285               Requires that no resource record exists of the specified
286               <em class="parameter"><code>type</code></em>,
287               <em class="parameter"><code>class</code></em>
288               and
289               <em class="parameter"><code>domain-name</code></em>.
290               If
291               <em class="parameter"><code>class</code></em>
292               is omitted, IN (internet) is assumed.
293             </p></dd>
294 <dt><span class="term">
295               <span><strong class="command">prereq yxrrset</strong></span>
296                {domain-name}
297                [class]
298                {type}
299             </span></dt>
300 <dd><p>
301               This requires that a resource record of the specified
302               <em class="parameter"><code>type</code></em>,
303               <em class="parameter"><code>class</code></em>
304               and
305               <em class="parameter"><code>domain-name</code></em>
306               must exist.
307               If
308               <em class="parameter"><code>class</code></em>
309               is omitted, IN (internet) is assumed.
310             </p></dd>
311 <dt><span class="term">
312               <span><strong class="command">prereq yxrrset</strong></span>
313                {domain-name}
314                [class]
315                {type}
316                {data...}
317             </span></dt>
318 <dd><p>
319               The
320               <em class="parameter"><code>data</code></em>
321               from each set of prerequisites of this form
322               sharing a common
323               <em class="parameter"><code>type</code></em>,
324               <em class="parameter"><code>class</code></em>,
325               and
326               <em class="parameter"><code>domain-name</code></em>
327               are combined to form a set of RRs.  This set of RRs must
328               exactly match the set of RRs existing in the zone at the
329               given
330               <em class="parameter"><code>type</code></em>,
331               <em class="parameter"><code>class</code></em>,
332               and
333               <em class="parameter"><code>domain-name</code></em>.
334               The
335               <em class="parameter"><code>data</code></em>
336               are written in the standard text representation of the resource
337               record's
338               RDATA.
339             </p></dd>
340 <dt><span class="term">
341               <span><strong class="command">update delete</strong></span>
342                {domain-name}
343                [ttl]
344                [class]
345                [type [data...]]
346             </span></dt>
347 <dd><p>
348               Deletes any resource records named
349               <em class="parameter"><code>domain-name</code></em>.
350               If
351               <em class="parameter"><code>type</code></em>
352               and
353               <em class="parameter"><code>data</code></em>
354               is provided, only matching resource records will be removed.
355               The internet class is assumed if
356               <em class="parameter"><code>class</code></em>
357               is not supplied.  The
358               <em class="parameter"><code>ttl</code></em>
359               is ignored, and is only allowed for compatibility.
360             </p></dd>
361 <dt><span class="term">
362               <span><strong class="command">update add</strong></span>
363                {domain-name}
364                {ttl}
365                [class]
366                {type}
367                {data...}
368             </span></dt>
369 <dd><p>
370               Adds a new resource record with the specified
371               <em class="parameter"><code>ttl</code></em>,
372               <em class="parameter"><code>class</code></em>
373               and
374               <em class="parameter"><code>data</code></em>.
375             </p></dd>
376 <dt><span class="term">
377               <span><strong class="command">show</strong></span>
378             </span></dt>
379 <dd><p>
380               Displays the current message, containing all of the
381               prerequisites and
382               updates specified since the last send.
383             </p></dd>
384 <dt><span class="term">
385               <span><strong class="command">send</strong></span>
386             </span></dt>
387 <dd><p>
388               Sends the current message.  This is equivalent to entering a
389               blank line.
390             </p></dd>
391 <dt><span class="term">
392               <span><strong class="command">answer</strong></span>
393             </span></dt>
394 <dd><p>
395               Displays the answer.
396             </p></dd>
397 </dl></div>
398 <p>
399     </p>
400 <p>
401       Lines beginning with a semicolon are comments and are ignored.
402     </p>
403 </div>
404 <div class="refsect1" lang="en">
405 <a name="id2544446"></a><h2>EXAMPLES</h2>
406 <p>
407       The examples below show how
408       <span><strong class="command">nsupdate</strong></span>
409       could be used to insert and delete resource records from the
410       <span class="type">example.com</span>
411       zone.
412       Notice that the input in each example contains a trailing blank line so
413       that
414       a group of commands are sent as one dynamic update request to the
415       master name server for
416       <span class="type">example.com</span>.
417
418       </p>
419 <pre class="programlisting">
420 # nsupdate
421 &gt; update delete oldhost.example.com A
422 &gt; update add newhost.example.com 86400 A 172.16.1.1
423 &gt; send
424 </pre>
425 <p>
426     </p>
427 <p>
428       Any A records for
429       <span class="type">oldhost.example.com</span>
430       are deleted.
431       And an A record for
432       <span class="type">newhost.example.com</span>
433       with IP address 172.16.1.1 is added.
434       The newly-added record has a 1 day TTL (86400 seconds).
435       </p>
436 <pre class="programlisting">
437 # nsupdate
438 &gt; prereq nxdomain nickname.example.com
439 &gt; update add nickname.example.com 86400 CNAME somehost.example.com
440 &gt; send
441 </pre>
442 <p>
443     </p>
444 <p>
445       The prerequisite condition gets the name server to check that there
446       are no resource records of any type for
447       <span class="type">nickname.example.com</span>.
448
449       If there are, the update request fails.
450       If this name does not exist, a CNAME for it is added.
451       This ensures that when the CNAME is added, it cannot conflict with the
452       long-standing rule in RFC1034 that a name must not exist as any other
453       record type if it exists as a CNAME.
454       (The rule has been updated for DNSSEC in RFC2535 to allow CNAMEs to have
455       RRSIG, DNSKEY and NSEC records.)
456     </p>
457 </div>
458 <div class="refsect1" lang="en">
459 <a name="id2544490"></a><h2>FILES</h2>
460 <div class="variablelist"><dl>
461 <dt><span class="term"><code class="constant">/etc/resolv.conf</code></span></dt>
462 <dd><p>
463             used to identify default name server
464           </p></dd>
465 <dt><span class="term"><code class="constant">K{name}.+157.+{random}.key</code></span></dt>
466 <dd><p>
467             base-64 encoding of HMAC-MD5 key created by
468             <span class="citerefentry"><span class="refentrytitle">dnssec-keygen</span>(8)</span>.
469           </p></dd>
470 <dt><span class="term"><code class="constant">K{name}.+157.+{random}.private</code></span></dt>
471 <dd><p>
472             base-64 encoding of HMAC-MD5 key created by
473             <span class="citerefentry"><span class="refentrytitle">dnssec-keygen</span>(8)</span>.
474           </p></dd>
475 </dl></div>
476 </div>
477 <div class="refsect1" lang="en">
478 <a name="id2544560"></a><h2>SEE ALSO</h2>
479 <p><span class="citerefentry"><span class="refentrytitle">RFC2136</span></span>,
480       <span class="citerefentry"><span class="refentrytitle">RFC3007</span></span>,
481       <span class="citerefentry"><span class="refentrytitle">RFC2104</span></span>,
482       <span class="citerefentry"><span class="refentrytitle">RFC2845</span></span>,
483       <span class="citerefentry"><span class="refentrytitle">RFC1034</span></span>,
484       <span class="citerefentry"><span class="refentrytitle">RFC2535</span></span>,
485       <span class="citerefentry"><span class="refentrytitle">RFC2931</span></span>,
486       <span class="citerefentry"><span class="refentrytitle">named</span>(8)</span>,
487       <span class="citerefentry"><span class="refentrytitle">dnssec-keygen</span>(8)</span>.
488     </p>
489 </div>
490 <div class="refsect1" lang="en">
491 <a name="id2542172"></a><h2>BUGS</h2>
492 <p>
493       The TSIG key is redundantly stored in two separate files.
494       This is a consequence of nsupdate using the DST library
495       for its cryptographic operations, and may change in future
496       releases.
497     </p>
498 </div>
499 </div></body>
500 </html>