]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/bind9/bin/nsupdate/nsupdate.docbook
This commit was generated by cvs2svn to compensate for changes in r168305,
[FreeBSD/FreeBSD.git] / contrib / bind9 / bin / nsupdate / nsupdate.docbook
1 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.0//EN"
2                "http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd"
3                [<!ENTITY mdash "&#8212;">]>
4 <!--
5  - Copyright (C) 2004, 2005  Internet Systems Consortium, Inc. ("ISC")
6  - Copyright (C) 2000-2003  Internet Software Consortium.
7  -
8  - Permission to use, copy, modify, and distribute this software for any
9  - purpose with or without fee is hereby granted, provided that the above
10  - copyright notice and this permission notice appear in all copies.
11  -
12  - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
13  - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
14  - AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
15  - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
16  - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
17  - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
18  - PERFORMANCE OF THIS SOFTWARE.
19 -->
20
21 <!-- $Id: nsupdate.docbook,v 1.8.2.3.2.10 2005/05/12 21:36:03 sra Exp $ -->
22
23 <refentry>
24 <refentryinfo>
25 <date>Jun 30, 2000</date>
26 </refentryinfo>
27 <refmeta>
28 <refentrytitle>nsupdate</refentrytitle>
29 <manvolnum>8</manvolnum>
30 <refmiscinfo>BIND9</refmiscinfo>
31 </refmeta>
32
33   <docinfo>
34     <copyright>
35       <year>2004</year>
36       <year>2005</year>
37       <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
38     </copyright>
39     <copyright>
40       <year>2000</year>
41       <year>2001</year>
42       <year>2002</year>
43       <year>2003</year>
44       <holder>Internet Software Consortium.</holder>
45     </copyright>
46   </docinfo>
47
48 <refnamediv>
49 <refname>nsupdate</refname>
50 <refpurpose>Dynamic DNS update utility</refpurpose>
51 </refnamediv>
52 <refsynopsisdiv>
53 <cmdsynopsis>
54 <command>nsupdate</command>
55 <arg><option>-d</option></arg>
56 <group>
57   <arg><option>-y <replaceable class="parameter">keyname:secret</replaceable></option></arg>
58   <arg><option>-k <replaceable class="parameter">keyfile</replaceable></option></arg>
59 </group>
60 <arg><option>-t <replaceable class="parameter">timeout</replaceable></option></arg>
61 <arg><option>-u <replaceable class="parameter">udptimeout</replaceable></option></arg>
62 <arg><option>-r <replaceable class="parameter">udpretries</replaceable></option></arg>
63 <arg><option>-v</option></arg>
64 <arg>filename</arg>
65 </cmdsynopsis>
66 </refsynopsisdiv>
67
68 <refsect1>
69 <title>DESCRIPTION</title>
70 <para>
71 <command>nsupdate</command>
72 is used to submit Dynamic DNS Update requests as defined in RFC2136
73 to a name server.
74 This allows resource records to be added or removed from a zone
75 without manually editing the zone file.
76 A single update request can contain requests to add or remove more than one
77 resource record.
78 </para>
79 <para>
80 Zones that are under dynamic control via
81 <command>nsupdate</command>
82 or a DHCP server should not be edited by hand.
83 Manual edits could
84 conflict with dynamic updates and cause data to be lost.
85 </para>
86 <para>
87 The resource records that are dynamically added or removed with
88 <command>nsupdate</command>
89 have to be in the same zone.
90 Requests are sent to the zone's master server.
91 This is identified by the MNAME field of the zone's SOA record.
92 </para>
93 <para>
94 The
95 <option>-d</option>
96 option makes
97 <command>nsupdate</command>
98 operate in debug mode.
99 This provides tracing information about the update requests that are
100 made and the replies received from the name server.
101 </para>
102 <para>
103 Transaction signatures can be used to authenticate the Dynamic DNS
104 updates.
105 These use the TSIG resource record type described in RFC2845 or the
106 SIG(0) record described in RFC3535 and RFC2931.
107 TSIG relies on a shared secret that should only be known to
108 <command>nsupdate</command> and the name server.
109 Currently, the only supported encryption algorithm for TSIG is
110 HMAC-MD5, which is defined in RFC 2104.
111 Once other algorithms are defined for TSIG, applications will need to
112 ensure they select the appropriate algorithm as well as the key when
113 authenticating each other.
114 For instance suitable
115 <type>key</type>
116 and
117 <type>server</type>
118 statements would be added to
119 <filename>/etc/named.conf</filename>
120 so that the name server can associate the appropriate secret key
121 and algorithm with the IP address of the
122 client application that will be using TSIG authentication.
123 SIG(0) uses public key cryptography.  To use a SIG(0) key, the public
124 key must be stored in a KEY record in a zone served by the name server.
125 <command>nsupdate</command>
126 does not read
127 <filename>/etc/named.conf</filename>.
128 </para>
129 <para>
130 <command>nsupdate</command>
131 uses the
132 <option>-y</option>
133 or
134 <option>-k</option>
135 option (with an HMAC-MD5 key) to provide the shared secret needed to generate
136 a TSIG record for authenticating Dynamic DNS update requests.
137 These options are mutually exclusive.
138 With the
139 <option>-k</option>
140 option,
141 <command>nsupdate</command>
142 reads the shared secret from the file
143 <parameter>keyfile</parameter>,
144 whose name is of the form 
145 <filename>K{name}.+157.+{random}.private</filename>.
146 For historical
147 reasons, the file 
148 <filename>K{name}.+157.+{random}.key</filename>
149 must also be present.  When the
150 <option>-y</option>
151 option is used, a signature is generated from
152 <parameter>keyname:secret.</parameter>
153 <parameter>keyname</parameter>
154 is the name of the key,
155 and
156 <parameter>secret</parameter>
157 is the base64 encoded shared secret.
158 Use of the
159 <option>-y</option>
160 option is discouraged because the shared secret is supplied as a command
161 line argument in clear text.
162 This may be visible in the output from
163 <citerefentry>
164 <refentrytitle>ps</refentrytitle><manvolnum>1
165 </manvolnum>
166 </citerefentry>
167 or in a history file maintained by the user's shell.
168 </para>
169 <para>
170 The <option>-k</option> may also be used to specify a SIG(0) key used
171 to authenticate Dynamic DNS update requests.  In this case, the key
172 specified is not an HMAC-MD5 key.
173 </para>
174 <para>
175 By default
176 <command>nsupdate</command>
177 uses UDP to send update requests to the name server unless they are too
178 large to fit in a UDP request in which case TCP will be used.
179 The
180 <option>-v</option>
181 option makes
182 <command>nsupdate</command>
183 use a TCP connection.
184 This may be preferable when a batch of update requests is made.
185 </para>
186 <para>The <option>-t</option> option sets the maximum time a update request can
187 take before it is aborted.  The default is 300 seconds.  Zero can be used
188 to disable the timeout.
189 </para>
190 <para>The <option>-u</option> option sets the UDP retry interval.  The default is
191 3 seconds.  If zero the interval will be computed from the timeout interval
192 and number of UDP retries.
193 </para>
194 <para>The <option>-r</option> option sets the number of UDP retries. The default is
195 3.  If zero only one update request will be made.
196 </para>
197 </refsect1>
198
199 <refsect1>
200 <title>INPUT FORMAT</title>
201 <para>
202 <command>nsupdate</command>
203 reads input from
204 <parameter>filename</parameter>
205 or standard input.
206 Each command is supplied on exactly one line of input.
207 Some commands are for administrative purposes.
208 The others are either update instructions or prerequisite checks on the
209 contents of the zone.
210 These checks set conditions that some name or set of
211 resource records (RRset) either exists or is absent from the zone.
212 These conditions must be met if the entire update request is to succeed.
213 Updates will be rejected if the tests for the prerequisite conditions fail.
214 </para>
215 <para>
216 Every update request consists of zero or more prerequisites
217 and zero or more updates.
218 This allows a suitably authenticated update request to proceed if some
219 specified resource records are present or missing from the zone.
220 A blank input line (or the <command>send</command> command) causes the
221 accumulated commands to be sent as one Dynamic DNS update request to the
222 name server.
223 </para>
224 <para>
225 The command formats and their meaning are as follows:
226 <variablelist>
227 <varlistentry><term>
228 <cmdsynopsis>
229 <command>server</command>
230 <arg choice="req">servername</arg>
231 <arg choice="opt">port</arg>
232 </cmdsynopsis>
233 </term>
234 <listitem>
235 <para>
236 Sends all dynamic update requests to the name server
237 <parameter>servername</parameter>.
238 When no server statement is provided,
239 <command>nsupdate</command>
240 will send updates to the master server of the correct zone.
241 The MNAME field of that zone's SOA record will identify the master
242 server for that zone.
243 <parameter>port</parameter>
244 is the port number on
245 <parameter>servername</parameter>
246 where the dynamic update requests get sent.
247 If no port number is specified, the default DNS port number of 53 is
248 used.
249 </para>
250 </listitem>
251 </varlistentry>
252
253 <varlistentry><term>
254 <cmdsynopsis>
255 <command>local</command>
256 <arg choice="req">address</arg>
257 <arg choice="opt">port</arg>
258 </cmdsynopsis>
259 </term>
260 <listitem>
261 <para>
262 Sends all dynamic update requests using the local
263 <parameter>address</parameter>.
264
265 When no local statement is provided,
266 <command>nsupdate</command>
267 will send updates using an address and port chosen by the system.
268 <parameter>port</parameter>
269 can additionally be used to make requests come from a specific port.
270 If no port number is specified, the system will assign one.
271 </para>
272 </listitem>
273 </varlistentry>
274
275 <varlistentry><term>
276 <cmdsynopsis>
277 <command>zone</command>
278 <arg choice="req">zonename</arg>
279 </cmdsynopsis>
280 </term>
281 <listitem>
282 <para>
283 Specifies that all updates are to be made to the zone
284 <parameter>zonename</parameter>.
285 If no
286 <parameter>zone</parameter>
287 statement is provided,
288 <command>nsupdate</command>
289 will attempt determine the correct zone to update based on the rest of the input.
290 </para>
291 </listitem>
292 </varlistentry>
293
294 <varlistentry><term>
295 <cmdsynopsis>
296 <command>class</command>
297 <arg choice="req">classname</arg>
298 </cmdsynopsis>
299 </term>
300 <listitem>
301 <para>
302 Specify the default class.
303 If no <parameter>class</parameter> is specified the default class is
304 <parameter>IN</parameter>.
305 </para>
306 </listitem>
307 </varlistentry>
308
309 <varlistentry><term>
310 <cmdsynopsis>
311 <command>key</command>
312 <arg choice="req">name</arg>
313 <arg choice="req">secret</arg>
314 </cmdsynopsis>
315 </term>
316 <listitem>
317 <para>
318 Specifies that all updates are to be TSIG signed using the
319 <parameter>keyname</parameter> <parameter>keysecret</parameter> pair.
320 The <command>key</command> command
321 overrides any key specified on the command line via
322 <option>-y</option> or <option>-k</option>.
323 </para>
324 </listitem>
325 </varlistentry>
326
327 <varlistentry><term>
328 <cmdsynopsis>
329 <command>prereq nxdomain</command>
330 <arg choice="req">domain-name</arg>
331 </cmdsynopsis>
332 </term>
333 <listitem>
334 <para>
335 Requires that no resource record of any type exists with name
336 <parameter>domain-name</parameter>.
337 </para>
338 </listitem>
339 </varlistentry>
340
341
342 <varlistentry><term>
343 <cmdsynopsis>
344 <command>prereq yxdomain</command>
345 <arg choice="req">domain-name</arg>
346 </cmdsynopsis>
347 </term>
348 <listitem>
349 <para>
350 Requires that
351 <parameter>domain-name</parameter>
352 exists (has as at least one resource record, of any type).
353 </para>
354 </listitem>
355 </varlistentry>
356
357 <varlistentry><term>
358 <cmdsynopsis>
359 <command>prereq nxrrset</command>
360 <arg choice="req">domain-name</arg>
361 <arg choice="opt">class</arg>
362 <arg choice="req">type</arg>
363 </cmdsynopsis>
364 </term>
365 <listitem>
366 <para>
367 Requires that no resource record exists of the specified
368 <parameter>type</parameter>,
369 <parameter>class</parameter>
370 and
371 <parameter>domain-name</parameter>.
372 If
373 <parameter>class</parameter>
374 is omitted, IN (internet) is assumed.
375 </para>
376 </listitem>
377 </varlistentry>
378
379
380 <varlistentry><term>
381 <cmdsynopsis>
382 <command>prereq yxrrset</command>
383 <arg choice="req">domain-name</arg>
384 <arg choice="opt">class</arg>
385 <arg choice="req">type</arg>
386 </cmdsynopsis>
387 </term>
388 <listitem>
389 <para>
390 This requires that a resource record of the specified
391 <parameter>type</parameter>,
392 <parameter>class</parameter>
393 and
394 <parameter>domain-name</parameter>
395 must exist.
396 If
397 <parameter>class</parameter>
398 is omitted, IN (internet) is assumed.
399 </para>
400 </listitem>
401 </varlistentry>
402
403 <varlistentry><term>
404 <cmdsynopsis>
405 <command>prereq yxrrset</command>
406 <arg choice="req">domain-name</arg>
407 <arg choice="opt">class</arg>
408 <arg choice="req">type</arg>
409 <arg choice="req" rep="repeat">data</arg>
410 </cmdsynopsis>
411 </term>
412 <listitem>
413 <para>
414 The
415 <parameter>data</parameter>
416 from each set of prerequisites of this form
417 sharing a common
418 <parameter>type</parameter>,
419 <parameter>class</parameter>,
420 and 
421 <parameter>domain-name</parameter>
422 are combined to form a set of RRs.  This set of RRs must
423 exactly match the set of RRs existing in the zone at the
424 given 
425 <parameter>type</parameter>,
426 <parameter>class</parameter>,
427 and 
428 <parameter>domain-name</parameter>.
429 The
430 <parameter>data</parameter>
431 are written in the standard text representation of the resource record's
432 RDATA.
433 </para>
434 </listitem>
435 </varlistentry>
436
437 <varlistentry><term>
438 <cmdsynopsis>
439 <command>update delete</command>
440 <arg choice="req">domain-name</arg>
441 <arg choice="opt">ttl</arg>
442 <arg choice="opt">class</arg>
443 <arg choice="opt">type <arg choice="opt" rep="repeat">data</arg></arg>
444 </cmdsynopsis>
445 </term>
446 <listitem>
447 <para>
448 Deletes any resource records named
449 <parameter>domain-name</parameter>.
450 If
451 <parameter>type</parameter>
452 and
453 <parameter>data</parameter>
454 is provided, only matching resource records will be removed.
455 The internet class is assumed if
456 <parameter>class</parameter>
457 is not supplied.  The
458 <parameter>ttl</parameter>
459 is ignored, and is only allowed for compatibility.
460 </para>
461 </listitem>
462 </varlistentry>
463
464 <varlistentry><term>
465 <cmdsynopsis>
466 <command>update add</command>
467 <arg choice="req">domain-name</arg>
468 <arg choice="req">ttl</arg>
469 <arg choice="opt">class</arg>
470 <arg choice="req">type</arg>
471 <arg choice="req" rep="repeat">data</arg>
472 </cmdsynopsis>
473 </term>
474 <listitem>
475 <para>
476 Adds a new resource record with the specified
477 <parameter>ttl</parameter>,
478 <parameter>class</parameter>
479 and
480 <parameter>data</parameter>.
481 </para>
482 </listitem>
483 </varlistentry>
484
485 <varlistentry><term>
486 <cmdsynopsis>
487 <command>show</command>
488 </cmdsynopsis>
489 </term>
490 <listitem>
491 <para>
492 Displays the current message, containing all of the prerequisites and
493 updates specified since the last send.
494 </para>
495 </listitem>
496 </varlistentry>
497
498 <varlistentry><term>
499 <cmdsynopsis>
500 <command>send</command>
501 </cmdsynopsis>
502 </term>
503 <listitem>
504 <para>
505 Sends the current message.  This is equivalent to entering a blank line.
506 </para>
507 </listitem>
508 </varlistentry>
509
510 <varlistentry><term>
511 <cmdsynopsis>
512 <command>answer</command>
513 </cmdsynopsis>
514 </term>
515 <listitem>
516 <para>
517 Displays the answer.
518 </para>
519 </listitem>
520 </varlistentry>
521
522 </variablelist>
523 </para>
524
525 <para>
526 Lines beginning with a semicolon are comments and are ignored.
527 </para>
528
529 </refsect1>
530
531 <refsect1>
532 <title>EXAMPLES</title>
533 <para>
534 The examples below show how
535 <command>nsupdate</command>
536 could be used to insert and delete resource records from the
537 <type>example.com</type>
538 zone.
539 Notice that the input in each example contains a trailing blank line so that
540 a group of commands are sent as one dynamic update request to the
541 master name server for
542 <type>example.com</type>.
543
544 <programlisting>
545 # nsupdate
546 > update delete oldhost.example.com A
547 > update add newhost.example.com 86400 A 172.16.1.1
548 > send
549 </programlisting>
550 </para>
551 <para>
552 Any A records for
553 <type>oldhost.example.com</type>
554 are deleted.
555 and an A record for
556 <type>newhost.example.com</type>
557 it IP address 172.16.1.1 is added.
558 The newly-added record has a 1 day TTL (86400 seconds)
559 <programlisting>
560 # nsupdate
561 > prereq nxdomain nickname.example.com
562 > update add nickname.example.com 86400 CNAME somehost.example.com
563 > send
564 </programlisting>
565 </para>
566 <para>
567 The prerequisite condition gets the name server to check that there
568 are no resource records of any type for
569 <type>nickname.example.com</type>.
570
571 If there are, the update request fails.
572 If this name does not exist, a CNAME for it is added.
573 This ensures that when the CNAME is added, it cannot conflict with the
574 long-standing rule in RFC1034 that a name must not exist as any other
575 record type if it exists as a CNAME.
576 (The rule has been updated for DNSSEC in RFC2535 to allow CNAMEs to have
577 RRSIG, DNSKEY and NSEC records.)
578 </para>
579 </refsect1>
580
581 <refsect1>
582 <title>FILES</title>
583
584 <variablelist>
585 <varlistentry><term><constant>/etc/resolv.conf</constant></term>
586 <listitem>
587 <para>
588 used to identify default name server
589 </para>
590 </listitem>
591 </varlistentry>
592
593 <varlistentry><term><constant>K{name}.+157.+{random}.key</constant></term>
594 <listitem>
595 <para>
596 base-64 encoding of HMAC-MD5 key created by
597 <citerefentry>
598 <refentrytitle>dnssec-keygen</refentrytitle><manvolnum>8</manvolnum>
599 </citerefentry>.
600 </para>
601 </listitem>
602 </varlistentry>
603
604 <varlistentry><term><constant>K{name}.+157.+{random}.private</constant></term>
605 <listitem>
606 <para>
607 base-64 encoding of HMAC-MD5 key created by
608 <citerefentry>
609 <refentrytitle>dnssec-keygen</refentrytitle><manvolnum>8</manvolnum>
610 </citerefentry>.
611 </para>
612 </listitem>
613 </varlistentry>
614 </variablelist>
615 </refsect1>
616
617 <refsect1>
618 <title>SEE ALSO</title>
619 <para>
620 <citerefentry>
621 <refentrytitle>RFC2136</refentrytitle>
622 </citerefentry>,
623 <citerefentry>
624 <refentrytitle>RFC3007</refentrytitle>
625 </citerefentry>,
626 <citerefentry>
627 <refentrytitle>RFC2104</refentrytitle>
628 </citerefentry>,
629 <citerefentry>
630 <refentrytitle>RFC2845</refentrytitle>
631 </citerefentry>,
632 <citerefentry>
633 <refentrytitle>RFC1034</refentrytitle>
634 </citerefentry>,
635 <citerefentry>
636 <refentrytitle>RFC2535</refentrytitle>
637 </citerefentry>,
638 <citerefentry>
639 <refentrytitle>RFC2931</refentrytitle>
640 </citerefentry>,
641 <citerefentry>
642 <refentrytitle>named</refentrytitle><manvolnum>8</manvolnum>
643 </citerefentry>,
644 <citerefentry>
645 <refentrytitle>dnssec-keygen</refentrytitle><manvolnum>8</manvolnum>
646 </citerefentry>.
647 </para>
648 </refsect1>
649 <refsect1>
650 <title>BUGS</title>
651 <para>
652 The TSIG key is redundantly stored in two separate files.
653 This is a consequence of nsupdate using the DST library
654 for its cryptographic operations, and may change in future
655 releases.
656 </para>
657 </refsect1>
658 </refentry>