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 "—">]>
5 - Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
6 - Copyright (C) 2000-2003 Internet Software Consortium.
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.
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.
21 <!-- $Id: nsupdate.docbook,v 1.34.48.3 2009/03/09 04:21:56 marka Exp $ -->
22 <refentry id="man.nsupdate">
24 <date>Jun 30, 2000</date>
27 <refentrytitle><application>nsupdate</application></refentrytitle>
28 <manvolnum>1</manvolnum>
29 <refmiscinfo>BIND9</refmiscinfo>
32 <refname><application>nsupdate</application></refname>
33 <refpurpose>Dynamic DNS update utility</refpurpose>
44 <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
51 <holder>Internet Software Consortium.</holder>
57 <command>nsupdate</command>
58 <arg><option>-d</option></arg>
59 <arg><option>-D</option></arg>
61 <arg><option>-g</option></arg>
62 <arg><option>-o</option></arg>
63 <arg><option>-y <replaceable class="parameter"><optional>hmac:</optional>keyname:secret</replaceable></option></arg>
64 <arg><option>-k <replaceable class="parameter">keyfile</replaceable></option></arg>
66 <arg><option>-t <replaceable class="parameter">timeout</replaceable></option></arg>
67 <arg><option>-u <replaceable class="parameter">udptimeout</replaceable></option></arg>
68 <arg><option>-r <replaceable class="parameter">udpretries</replaceable></option></arg>
69 <arg><option>-R <replaceable class="parameter">randomdev</replaceable></option></arg>
70 <arg><option>-v</option></arg>
76 <title>DESCRIPTION</title>
77 <para><command>nsupdate</command>
78 is used to submit Dynamic DNS Update requests as defined in RFC2136
80 This allows resource records to be added or removed from a zone
81 without manually editing the zone file.
82 A single update request can contain requests to add or remove more than
87 Zones that are under dynamic control via
88 <command>nsupdate</command>
89 or a DHCP server should not be edited by hand.
91 conflict with dynamic updates and cause data to be lost.
94 The resource records that are dynamically added or removed with
95 <command>nsupdate</command>
96 have to be in the same zone.
97 Requests are sent to the zone's master server.
98 This is identified by the MNAME field of the zone's SOA record.
104 <command>nsupdate</command>
105 operate in debug mode.
106 This provides tracing information about the update requests that are
107 made and the replies received from the name server.
110 The <option>-D</option> option makes <command>nsupdate</command>
111 report additional debugging information to <option>-d</option>.
114 Transaction signatures can be used to authenticate the Dynamic
115 DNS updates. These use the TSIG resource record type described
116 in RFC2845 or the SIG(0) record described in RFC3535 and
117 RFC2931 or GSS-TSIG as described in RFC3645. TSIG relies on
118 a shared secret that should only be known to
119 <command>nsupdate</command> and the name server. Currently,
120 the only supported encryption algorithm for TSIG is HMAC-MD5,
121 which is defined in RFC 2104. Once other algorithms are
122 defined for TSIG, applications will need to ensure they select
123 the appropriate algorithm as well as the key when authenticating
124 each other. For instance, suitable <type>key</type> and
125 <type>server</type> statements would be added to
126 <filename>/etc/named.conf</filename> so that the name server
127 can associate the appropriate secret key and algorithm with
128 the IP address of the client application that will be using
129 TSIG authentication. SIG(0) uses public key cryptography.
130 To use a SIG(0) key, the public key must be stored in a KEY
131 record in a zone served by the name server.
132 <command>nsupdate</command> does not read
133 <filename>/etc/named.conf</filename>.
134 GSS-TSIG uses Kerberos credentials.
136 <para><command>nsupdate</command>
137 uses the <option>-y</option> or <option>-k</option> option
138 to provide the shared secret needed to generate a TSIG record
139 for authenticating Dynamic DNS update requests, default type
140 HMAC-MD5. These options are mutually exclusive. With the
141 <option>-k</option> option, <command>nsupdate</command> reads
142 the shared secret from the file <parameter>keyfile</parameter>,
143 whose name is of the form
144 <filename>K{name}.+157.+{random}.private</filename>. For
145 historical reasons, the file
146 <filename>K{name}.+157.+{random}.key</filename> must also be
147 present. When the <option>-y</option> option is used, a
148 signature is generated from
149 <optional><parameter>hmac:</parameter></optional><parameter>keyname:secret.</parameter>
150 <parameter>keyname</parameter> is the name of the key, and
151 <parameter>secret</parameter> is the base64 encoded shared
152 secret. Use of the <option>-y</option> option is discouraged
153 because the shared secret is supplied as a command line
154 argument in clear text. This may be visible in the output
157 <refentrytitle>ps</refentrytitle><manvolnum>1</manvolnum>
158 </citerefentry> or in a history file maintained by the user's
162 The <option>-k</option> may also be used to specify a SIG(0) key used
163 to authenticate Dynamic DNS update requests. In this case, the key
164 specified is not an HMAC-MD5 key.
167 The <option>-g</option> and <option>-o</option> specify that
168 GSS-TSIG is to be used. The <option>-o</option> should only
169 be used with old Microsoft Windows 2000 servers.
173 <command>nsupdate</command>
174 uses UDP to send update requests to the name server unless they are too
175 large to fit in a UDP request in which case TCP will be used.
179 <command>nsupdate</command>
180 use a TCP connection.
181 This may be preferable when a batch of update requests is made.
184 The <option>-t</option> option sets the maximum time an update request
186 take before it is aborted. The default is 300 seconds. Zero can be
188 to disable the timeout.
191 The <option>-u</option> option sets the UDP retry interval. The default
193 3 seconds. If zero, the interval will be computed from the timeout
195 and number of UDP retries.
198 The <option>-r</option> option sets the number of UDP retries. The
200 3. If zero, only one update request will be made.
203 The <option>-R <replaceable
204 class="parameter">randomdev</replaceable></option> option
205 specifies a source of randomness. If the operating system
206 does not provide a <filename>/dev/random</filename> or
207 equivalent device, the default source of randomness is keyboard
208 input. <filename>randomdev</filename> specifies the name of
209 a character device or file containing random data to be used
210 instead of the default. The special value
211 <filename>keyboard</filename> indicates that keyboard input
212 should be used. This option may be specified multiple times.
217 <title>INPUT FORMAT</title>
218 <para><command>nsupdate</command>
220 <parameter>filename</parameter>
222 Each command is supplied on exactly one line of input.
223 Some commands are for administrative purposes.
224 The others are either update instructions or prerequisite checks on the
225 contents of the zone.
226 These checks set conditions that some name or set of
227 resource records (RRset) either exists or is absent from the zone.
228 These conditions must be met if the entire update request is to succeed.
229 Updates will be rejected if the tests for the prerequisite conditions
233 Every update request consists of zero or more prerequisites
234 and zero or more updates.
235 This allows a suitably authenticated update request to proceed if some
236 specified resource records are present or missing from the zone.
237 A blank input line (or the <command>send</command> command)
239 accumulated commands to be sent as one Dynamic DNS update request to the
243 The command formats and their meaning are as follows:
248 <command>server</command>
249 <arg choice="req">servername</arg>
250 <arg choice="opt">port</arg>
254 Sends all dynamic update requests to the name server
255 <parameter>servername</parameter>.
256 When no server statement is provided,
257 <command>nsupdate</command>
258 will send updates to the master server of the correct zone.
259 The MNAME field of that zone's SOA record will identify the
261 server for that zone.
262 <parameter>port</parameter>
263 is the port number on
264 <parameter>servername</parameter>
265 where the dynamic update requests get sent.
266 If no port number is specified, the default DNS port number of
275 <command>local</command>
276 <arg choice="req">address</arg>
277 <arg choice="opt">port</arg>
281 Sends all dynamic update requests using the local
282 <parameter>address</parameter>.
284 When no local statement is provided,
285 <command>nsupdate</command>
286 will send updates using an address and port chosen by the
288 <parameter>port</parameter>
289 can additionally be used to make requests come from a specific
291 If no port number is specified, the system will assign one.
298 <command>zone</command>
299 <arg choice="req">zonename</arg>
303 Specifies that all updates are to be made to the zone
304 <parameter>zonename</parameter>.
306 <parameter>zone</parameter>
307 statement is provided,
308 <command>nsupdate</command>
309 will attempt determine the correct zone to update based on the
317 <command>class</command>
318 <arg choice="req">classname</arg>
322 Specify the default class.
323 If no <parameter>class</parameter> is specified, the
325 <parameter>IN</parameter>.
332 <command>ttl</command>
333 <arg choice="req">seconds</arg>
337 Specify the default time to live for records to be added.
338 The value <parameter>none</parameter> will clear the default
346 <command>key</command>
347 <arg choice="req">name</arg>
348 <arg choice="req">secret</arg>
352 Specifies that all updates are to be TSIG-signed using the
353 <parameter>keyname</parameter> <parameter>keysecret</parameter> pair.
354 The <command>key</command> command
355 overrides any key specified on the command line via
356 <option>-y</option> or <option>-k</option>.
363 <command>prereq nxdomain</command>
364 <arg choice="req">domain-name</arg>
368 Requires that no resource record of any type exists with name
369 <parameter>domain-name</parameter>.
377 <command>prereq yxdomain</command>
378 <arg choice="req">domain-name</arg>
383 <parameter>domain-name</parameter>
384 exists (has as at least one resource record, of any type).
391 <command>prereq nxrrset</command>
392 <arg choice="req">domain-name</arg>
393 <arg choice="opt">class</arg>
394 <arg choice="req">type</arg>
398 Requires that no resource record exists of the specified
399 <parameter>type</parameter>,
400 <parameter>class</parameter>
402 <parameter>domain-name</parameter>.
404 <parameter>class</parameter>
405 is omitted, IN (internet) is assumed.
413 <command>prereq yxrrset</command>
414 <arg choice="req">domain-name</arg>
415 <arg choice="opt">class</arg>
416 <arg choice="req">type</arg>
420 This requires that a resource record of the specified
421 <parameter>type</parameter>,
422 <parameter>class</parameter>
424 <parameter>domain-name</parameter>
427 <parameter>class</parameter>
428 is omitted, IN (internet) is assumed.
435 <command>prereq yxrrset</command>
436 <arg choice="req">domain-name</arg>
437 <arg choice="opt">class</arg>
438 <arg choice="req">type</arg>
439 <arg choice="req" rep="repeat">data</arg>
444 <parameter>data</parameter>
445 from each set of prerequisites of this form
447 <parameter>type</parameter>,
448 <parameter>class</parameter>,
450 <parameter>domain-name</parameter>
451 are combined to form a set of RRs. This set of RRs must
452 exactly match the set of RRs existing in the zone at the
454 <parameter>type</parameter>,
455 <parameter>class</parameter>,
457 <parameter>domain-name</parameter>.
459 <parameter>data</parameter>
460 are written in the standard text representation of the resource
469 <command>update delete</command>
470 <arg choice="req">domain-name</arg>
471 <arg choice="opt">ttl</arg>
472 <arg choice="opt">class</arg>
473 <arg choice="opt">type <arg choice="opt" rep="repeat">data</arg></arg>
477 Deletes any resource records named
478 <parameter>domain-name</parameter>.
480 <parameter>type</parameter>
482 <parameter>data</parameter>
483 is provided, only matching resource records will be removed.
484 The internet class is assumed if
485 <parameter>class</parameter>
487 <parameter>ttl</parameter>
488 is ignored, and is only allowed for compatibility.
495 <command>update add</command>
496 <arg choice="req">domain-name</arg>
497 <arg choice="req">ttl</arg>
498 <arg choice="opt">class</arg>
499 <arg choice="req">type</arg>
500 <arg choice="req" rep="repeat">data</arg>
504 Adds a new resource record with the specified
505 <parameter>ttl</parameter>,
506 <parameter>class</parameter>
508 <parameter>data</parameter>.
515 <command>show</command>
519 Displays the current message, containing all of the
521 updates specified since the last send.
528 <command>send</command>
532 Sends the current message. This is equivalent to entering a
540 <command>answer</command>
551 <command>debug</command>
564 Lines beginning with a semicolon are comments and are ignored.
570 <title>EXAMPLES</title>
572 The examples below show how
573 <command>nsupdate</command>
574 could be used to insert and delete resource records from the
575 <type>example.com</type>
577 Notice that the input in each example contains a trailing blank line so
579 a group of commands are sent as one dynamic update request to the
580 master name server for
581 <type>example.com</type>.
585 > update delete oldhost.example.com A
586 > update add newhost.example.com 86400 A 172.16.1.1
592 <type>oldhost.example.com</type>
595 <type>newhost.example.com</type>
596 with IP address 172.16.1.1 is added.
597 The newly-added record has a 1 day TTL (86400 seconds).
600 > prereq nxdomain nickname.example.com
601 > update add nickname.example.com 86400 CNAME somehost.example.com
606 The prerequisite condition gets the name server to check that there
607 are no resource records of any type for
608 <type>nickname.example.com</type>.
610 If there are, the update request fails.
611 If this name does not exist, a CNAME for it is added.
612 This ensures that when the CNAME is added, it cannot conflict with the
613 long-standing rule in RFC1034 that a name must not exist as any other
614 record type if it exists as a CNAME.
615 (The rule has been updated for DNSSEC in RFC2535 to allow CNAMEs to have
616 RRSIG, DNSKEY and NSEC records.)
625 <term><constant>/etc/resolv.conf</constant></term>
628 used to identify default name server
634 <term><constant>K{name}.+157.+{random}.key</constant></term>
637 base-64 encoding of HMAC-MD5 key created by
639 <refentrytitle>dnssec-keygen</refentrytitle><manvolnum>8</manvolnum>
646 <term><constant>K{name}.+157.+{random}.private</constant></term>
649 base-64 encoding of HMAC-MD5 key created by
651 <refentrytitle>dnssec-keygen</refentrytitle><manvolnum>8</manvolnum>
661 <title>SEE ALSO</title>
663 <refentrytitle>RFC2136</refentrytitle>
666 <refentrytitle>RFC3007</refentrytitle>
669 <refentrytitle>RFC2104</refentrytitle>
672 <refentrytitle>RFC2845</refentrytitle>
675 <refentrytitle>RFC1034</refentrytitle>
678 <refentrytitle>RFC2535</refentrytitle>
681 <refentrytitle>RFC2931</refentrytitle>
684 <refentrytitle>named</refentrytitle><manvolnum>8</manvolnum>
687 <refentrytitle>dnssec-keygen</refentrytitle><manvolnum>8</manvolnum>
695 The TSIG key is redundantly stored in two separate files.
696 This is a consequence of nsupdate using the DST library
697 for its cryptographic operations, and may change in future