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-2008 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.18.18.12 2008/08/29 23:46:16 tbox Exp $ -->
24 <date>Jun 30, 2000</date>
27 <refentrytitle>nsupdate</refentrytitle>
28 <manvolnum>1</manvolnum>
29 <refmiscinfo>BIND9</refmiscinfo>
32 <refname>nsupdate</refname>
33 <refpurpose>Dynamic DNS update utility</refpurpose>
43 <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
50 <holder>Internet Software Consortium.</holder>
56 <command>nsupdate</command>
57 <arg><option>-d</option></arg>
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>
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>
71 <title>DESCRIPTION</title>
72 <para><command>nsupdate</command>
73 is used to submit Dynamic DNS Update requests as defined in RFC2136
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
82 Zones that are under dynamic control via
83 <command>nsupdate</command>
84 or a DHCP server should not be edited by hand.
86 conflict with dynamic updates and cause data to be lost.
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.
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.
105 Transaction signatures can be used to authenticate the Dynamic DNS
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
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>
129 <filename>/etc/named.conf</filename>.
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
152 <refentrytitle>ps</refentrytitle><manvolnum>1</manvolnum>
153 </citerefentry> or in a history file maintained by the user's
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.
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.
169 <command>nsupdate</command>
170 use a TCP connection.
171 This may be preferable when a batch of update requests is made.
174 The <option>-t</option> option sets the maximum time an update request
176 take before it is aborted. The default is 300 seconds. Zero can be
178 to disable the timeout.
181 The <option>-u</option> option sets the UDP retry interval. The default
183 3 seconds. If zero, the interval will be computed from the timeout
185 and number of UDP retries.
188 The <option>-r</option> option sets the number of UDP retries. The
190 3. If zero, only one update request will be made.
195 <title>INPUT FORMAT</title>
196 <para><command>nsupdate</command>
198 <parameter>filename</parameter>
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
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)
217 accumulated commands to be sent as one Dynamic DNS update request to the
221 The command formats and their meaning are as follows:
226 <command>server</command>
227 <arg choice="req">servername</arg>
228 <arg choice="opt">port</arg>
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
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
253 <command>local</command>
254 <arg choice="req">address</arg>
255 <arg choice="opt">port</arg>
259 Sends all dynamic update requests using the local
260 <parameter>address</parameter>.
262 When no local statement is provided,
263 <command>nsupdate</command>
264 will send updates using an address and port chosen by the
266 <parameter>port</parameter>
267 can additionally be used to make requests come from a specific
269 If no port number is specified, the system will assign one.
276 <command>zone</command>
277 <arg choice="req">zonename</arg>
281 Specifies that all updates are to be made to the zone
282 <parameter>zonename</parameter>.
284 <parameter>zone</parameter>
285 statement is provided,
286 <command>nsupdate</command>
287 will attempt determine the correct zone to update based on the
295 <command>class</command>
296 <arg choice="req">classname</arg>
300 Specify the default class.
301 If no <parameter>class</parameter> is specified, the
303 <parameter>IN</parameter>.
310 <command>key</command>
311 <arg choice="req">name</arg>
312 <arg choice="req">secret</arg>
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>.
327 <command>prereq nxdomain</command>
328 <arg choice="req">domain-name</arg>
332 Requires that no resource record of any type exists with name
333 <parameter>domain-name</parameter>.
341 <command>prereq yxdomain</command>
342 <arg choice="req">domain-name</arg>
347 <parameter>domain-name</parameter>
348 exists (has as at least one resource record, of any type).
355 <command>prereq nxrrset</command>
356 <arg choice="req">domain-name</arg>
357 <arg choice="opt">class</arg>
358 <arg choice="req">type</arg>
362 Requires that no resource record exists of the specified
363 <parameter>type</parameter>,
364 <parameter>class</parameter>
366 <parameter>domain-name</parameter>.
368 <parameter>class</parameter>
369 is omitted, IN (internet) is assumed.
377 <command>prereq yxrrset</command>
378 <arg choice="req">domain-name</arg>
379 <arg choice="opt">class</arg>
380 <arg choice="req">type</arg>
384 This requires that a resource record of the specified
385 <parameter>type</parameter>,
386 <parameter>class</parameter>
388 <parameter>domain-name</parameter>
391 <parameter>class</parameter>
392 is omitted, IN (internet) is assumed.
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>
408 <parameter>data</parameter>
409 from each set of prerequisites of this form
411 <parameter>type</parameter>,
412 <parameter>class</parameter>,
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
418 <parameter>type</parameter>,
419 <parameter>class</parameter>,
421 <parameter>domain-name</parameter>.
423 <parameter>data</parameter>
424 are written in the standard text representation of the resource
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>
441 Deletes any resource records named
442 <parameter>domain-name</parameter>.
444 <parameter>type</parameter>
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>
451 <parameter>ttl</parameter>
452 is ignored, and is only allowed for compatibility.
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>
468 Adds a new resource record with the specified
469 <parameter>ttl</parameter>,
470 <parameter>class</parameter>
472 <parameter>data</parameter>.
479 <command>show</command>
483 Displays the current message, containing all of the
485 updates specified since the last send.
492 <command>send</command>
496 Sends the current message. This is equivalent to entering a
504 <command>answer</command>
517 Lines beginning with a semicolon are comments and are ignored.
523 <title>EXAMPLES</title>
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>
530 Notice that the input in each example contains a trailing blank line so
532 a group of commands are sent as one dynamic update request to the
533 master name server for
534 <type>example.com</type>.
538 > update delete oldhost.example.com A
539 > update add newhost.example.com 86400 A 172.16.1.1
545 <type>oldhost.example.com</type>
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).
553 > prereq nxdomain nickname.example.com
554 > update add nickname.example.com 86400 CNAME somehost.example.com
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>.
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.)
578 <term><constant>/etc/resolv.conf</constant></term>
581 used to identify default name server
587 <term><constant>K{name}.+157.+{random}.key</constant></term>
590 base-64 encoding of HMAC-MD5 key created by
592 <refentrytitle>dnssec-keygen</refentrytitle><manvolnum>8</manvolnum>
599 <term><constant>K{name}.+157.+{random}.private</constant></term>
602 base-64 encoding of HMAC-MD5 key created by
604 <refentrytitle>dnssec-keygen</refentrytitle><manvolnum>8</manvolnum>
614 <title>SEE ALSO</title>
616 <refentrytitle>RFC2136</refentrytitle>
619 <refentrytitle>RFC3007</refentrytitle>
622 <refentrytitle>RFC2104</refentrytitle>
625 <refentrytitle>RFC2845</refentrytitle>
628 <refentrytitle>RFC1034</refentrytitle>
631 <refentrytitle>RFC2535</refentrytitle>
634 <refentrytitle>RFC2931</refentrytitle>
637 <refentrytitle>named</refentrytitle><manvolnum>8</manvolnum>
640 <refentrytitle>dnssec-keygen</refentrytitle><manvolnum>8</manvolnum>
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