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