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