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-2007 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.10 2007/08/28 07:20:01 tbox Exp $ -->
24 <date>Jun 30, 2000</date>
27 <refentrytitle>nsupdate</refentrytitle>
28 <manvolnum>8</manvolnum>
29 <refmiscinfo>BIND9</refmiscinfo>
32 <refname>nsupdate</refname>
33 <refpurpose>Dynamic DNS update utility</refpurpose>
42 <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
49 <holder>Internet Software Consortium.</holder>
55 <command>nsupdate</command>
56 <arg><option>-d</option></arg>
58 <arg><option>-y <replaceable class="parameter"><optional>hmac:</optional>keyname:secret</replaceable></option></arg>
59 <arg><option>-k <replaceable class="parameter">keyfile</replaceable></option></arg>
61 <arg><option>-t <replaceable class="parameter">timeout</replaceable></option></arg>
62 <arg><option>-u <replaceable class="parameter">udptimeout</replaceable></option></arg>
63 <arg><option>-r <replaceable class="parameter">udpretries</replaceable></option></arg>
64 <arg><option>-v</option></arg>
70 <title>DESCRIPTION</title>
71 <para><command>nsupdate</command>
72 is used to submit Dynamic DNS Update requests as defined in RFC2136
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
81 Zones that are under dynamic control via
82 <command>nsupdate</command>
83 or a DHCP server should not be edited by hand.
85 conflict with dynamic updates and cause data to be lost.
88 The resource records that are dynamically added or removed with
89 <command>nsupdate</command>
90 have to be in the same zone.
91 Requests are sent to the zone's master server.
92 This is identified by the MNAME field of the zone's SOA record.
98 <command>nsupdate</command>
99 operate in debug mode.
100 This provides tracing information about the update requests that are
101 made and the replies received from the name server.
104 Transaction signatures can be used to authenticate the Dynamic DNS
106 These use the TSIG resource record type described in RFC2845 or the
107 SIG(0) record described in RFC3535 and RFC2931.
108 TSIG relies on a shared secret that should only be known to
109 <command>nsupdate</command> and the name server.
110 Currently, the only supported encryption algorithm for TSIG is
111 HMAC-MD5, which is defined in RFC 2104.
112 Once other algorithms are defined for TSIG, applications will need to
113 ensure they select the appropriate algorithm as well as the key when
114 authenticating each other.
115 For instance, suitable
119 statements would be added to
120 <filename>/etc/named.conf</filename>
121 so that the name server can associate the appropriate secret key
122 and algorithm with the IP address of the
123 client application that will be using TSIG authentication.
124 SIG(0) uses public key cryptography. To use a SIG(0) key, the public
125 key must be stored in a KEY record in a zone served by the name server.
126 <command>nsupdate</command>
128 <filename>/etc/named.conf</filename>.
130 <para><command>nsupdate</command>
131 uses the <option>-y</option> or <option>-k</option> option
132 to provide the shared secret needed to generate a TSIG record
133 for authenticating Dynamic DNS update requests, default type
134 HMAC-MD5. These options are mutually exclusive. With the
135 <option>-k</option> option, <command>nsupdate</command> reads
136 the shared secret from the file <parameter>keyfile</parameter>,
137 whose name is of the form
138 <filename>K{name}.+157.+{random}.private</filename>. For
139 historical reasons, the file
140 <filename>K{name}.+157.+{random}.key</filename> must also be
141 present. When the <option>-y</option> option is used, a
142 signature is generated from
143 <optional><parameter>hmac:</parameter></optional><parameter>keyname:secret.</parameter>
144 <parameter>keyname</parameter> is the name of the key, and
145 <parameter>secret</parameter> is the base64 encoded shared
146 secret. Use of the <option>-y</option> option is discouraged
147 because the shared secret is supplied as a command line
148 argument in clear text. This may be visible in the output
151 <refentrytitle>ps</refentrytitle><manvolnum>1</manvolnum>
152 </citerefentry> or in a history file maintained by the user's
156 The <option>-k</option> may also be used to specify a SIG(0) key used
157 to authenticate Dynamic DNS update requests. In this case, the key
158 specified is not an HMAC-MD5 key.
162 <command>nsupdate</command>
163 uses UDP to send update requests to the name server unless they are too
164 large to fit in a UDP request in which case TCP will be used.
168 <command>nsupdate</command>
169 use a TCP connection.
170 This may be preferable when a batch of update requests is made.
173 The <option>-t</option> option sets the maximum time an update request
175 take before it is aborted. The default is 300 seconds. Zero can be
177 to disable the timeout.
180 The <option>-u</option> option sets the UDP retry interval. The default
182 3 seconds. If zero, the interval will be computed from the timeout
184 and number of UDP retries.
187 The <option>-r</option> option sets the number of UDP retries. The
189 3. If zero, only one update request will be made.
194 <title>INPUT FORMAT</title>
195 <para><command>nsupdate</command>
197 <parameter>filename</parameter>
199 Each command is supplied on exactly one line of input.
200 Some commands are for administrative purposes.
201 The others are either update instructions or prerequisite checks on the
202 contents of the zone.
203 These checks set conditions that some name or set of
204 resource records (RRset) either exists or is absent from the zone.
205 These conditions must be met if the entire update request is to succeed.
206 Updates will be rejected if the tests for the prerequisite conditions
210 Every update request consists of zero or more prerequisites
211 and zero or more updates.
212 This allows a suitably authenticated update request to proceed if some
213 specified resource records are present or missing from the zone.
214 A blank input line (or the <command>send</command> command)
216 accumulated commands to be sent as one Dynamic DNS update request to the
220 The command formats and their meaning are as follows:
225 <command>server</command>
226 <arg choice="req">servername</arg>
227 <arg choice="opt">port</arg>
231 Sends all dynamic update requests to the name server
232 <parameter>servername</parameter>.
233 When no server statement is provided,
234 <command>nsupdate</command>
235 will send updates to the master server of the correct zone.
236 The MNAME field of that zone's SOA record will identify the
238 server for that zone.
239 <parameter>port</parameter>
240 is the port number on
241 <parameter>servername</parameter>
242 where the dynamic update requests get sent.
243 If no port number is specified, the default DNS port number of
252 <command>local</command>
253 <arg choice="req">address</arg>
254 <arg choice="opt">port</arg>
258 Sends all dynamic update requests using the local
259 <parameter>address</parameter>.
261 When no local statement is provided,
262 <command>nsupdate</command>
263 will send updates using an address and port chosen by the
265 <parameter>port</parameter>
266 can additionally be used to make requests come from a specific
268 If no port number is specified, the system will assign one.
275 <command>zone</command>
276 <arg choice="req">zonename</arg>
280 Specifies that all updates are to be made to the zone
281 <parameter>zonename</parameter>.
283 <parameter>zone</parameter>
284 statement is provided,
285 <command>nsupdate</command>
286 will attempt determine the correct zone to update based on the
294 <command>class</command>
295 <arg choice="req">classname</arg>
299 Specify the default class.
300 If no <parameter>class</parameter> is specified, the
302 <parameter>IN</parameter>.
309 <command>key</command>
310 <arg choice="req">name</arg>
311 <arg choice="req">secret</arg>
315 Specifies that all updates are to be TSIG-signed using the
316 <parameter>keyname</parameter> <parameter>keysecret</parameter> pair.
317 The <command>key</command> command
318 overrides any key specified on the command line via
319 <option>-y</option> or <option>-k</option>.
326 <command>prereq nxdomain</command>
327 <arg choice="req">domain-name</arg>
331 Requires that no resource record of any type exists with name
332 <parameter>domain-name</parameter>.
340 <command>prereq yxdomain</command>
341 <arg choice="req">domain-name</arg>
346 <parameter>domain-name</parameter>
347 exists (has as at least one resource record, of any type).
354 <command>prereq nxrrset</command>
355 <arg choice="req">domain-name</arg>
356 <arg choice="opt">class</arg>
357 <arg choice="req">type</arg>
361 Requires that no resource record exists of the specified
362 <parameter>type</parameter>,
363 <parameter>class</parameter>
365 <parameter>domain-name</parameter>.
367 <parameter>class</parameter>
368 is omitted, IN (internet) is assumed.
376 <command>prereq yxrrset</command>
377 <arg choice="req">domain-name</arg>
378 <arg choice="opt">class</arg>
379 <arg choice="req">type</arg>
383 This requires that a resource record of the specified
384 <parameter>type</parameter>,
385 <parameter>class</parameter>
387 <parameter>domain-name</parameter>
390 <parameter>class</parameter>
391 is omitted, IN (internet) is assumed.
398 <command>prereq yxrrset</command>
399 <arg choice="req">domain-name</arg>
400 <arg choice="opt">class</arg>
401 <arg choice="req">type</arg>
402 <arg choice="req" rep="repeat">data</arg>
407 <parameter>data</parameter>
408 from each set of prerequisites of this form
410 <parameter>type</parameter>,
411 <parameter>class</parameter>,
413 <parameter>domain-name</parameter>
414 are combined to form a set of RRs. This set of RRs must
415 exactly match the set of RRs existing in the zone at the
417 <parameter>type</parameter>,
418 <parameter>class</parameter>,
420 <parameter>domain-name</parameter>.
422 <parameter>data</parameter>
423 are written in the standard text representation of the resource
432 <command>update delete</command>
433 <arg choice="req">domain-name</arg>
434 <arg choice="opt">ttl</arg>
435 <arg choice="opt">class</arg>
436 <arg choice="opt">type <arg choice="opt" rep="repeat">data</arg></arg>
440 Deletes any resource records named
441 <parameter>domain-name</parameter>.
443 <parameter>type</parameter>
445 <parameter>data</parameter>
446 is provided, only matching resource records will be removed.
447 The internet class is assumed if
448 <parameter>class</parameter>
450 <parameter>ttl</parameter>
451 is ignored, and is only allowed for compatibility.
458 <command>update add</command>
459 <arg choice="req">domain-name</arg>
460 <arg choice="req">ttl</arg>
461 <arg choice="opt">class</arg>
462 <arg choice="req">type</arg>
463 <arg choice="req" rep="repeat">data</arg>
467 Adds a new resource record with the specified
468 <parameter>ttl</parameter>,
469 <parameter>class</parameter>
471 <parameter>data</parameter>.
478 <command>show</command>
482 Displays the current message, containing all of the
484 updates specified since the last send.
491 <command>send</command>
495 Sends the current message. This is equivalent to entering a
503 <command>answer</command>
516 Lines beginning with a semicolon are comments and are ignored.
522 <title>EXAMPLES</title>
524 The examples below show how
525 <command>nsupdate</command>
526 could be used to insert and delete resource records from the
527 <type>example.com</type>
529 Notice that the input in each example contains a trailing blank line so
531 a group of commands are sent as one dynamic update request to the
532 master name server for
533 <type>example.com</type>.
537 > update delete oldhost.example.com A
538 > update add newhost.example.com 86400 A 172.16.1.1
544 <type>oldhost.example.com</type>
547 <type>newhost.example.com</type>
548 with IP address 172.16.1.1 is added.
549 The newly-added record has a 1 day TTL (86400 seconds).
552 > prereq nxdomain nickname.example.com
553 > update add nickname.example.com 86400 CNAME somehost.example.com
558 The prerequisite condition gets the name server to check that there
559 are no resource records of any type for
560 <type>nickname.example.com</type>.
562 If there are, the update request fails.
563 If this name does not exist, a CNAME for it is added.
564 This ensures that when the CNAME is added, it cannot conflict with the
565 long-standing rule in RFC1034 that a name must not exist as any other
566 record type if it exists as a CNAME.
567 (The rule has been updated for DNSSEC in RFC2535 to allow CNAMEs to have
568 RRSIG, DNSKEY and NSEC records.)
577 <term><constant>/etc/resolv.conf</constant></term>
580 used to identify default name server
586 <term><constant>K{name}.+157.+{random}.key</constant></term>
589 base-64 encoding of HMAC-MD5 key created by
591 <refentrytitle>dnssec-keygen</refentrytitle><manvolnum>8</manvolnum>
598 <term><constant>K{name}.+157.+{random}.private</constant></term>
601 base-64 encoding of HMAC-MD5 key created by
603 <refentrytitle>dnssec-keygen</refentrytitle><manvolnum>8</manvolnum>
613 <title>SEE ALSO</title>
615 <refentrytitle>RFC2136</refentrytitle>
618 <refentrytitle>RFC3007</refentrytitle>
621 <refentrytitle>RFC2104</refentrytitle>
624 <refentrytitle>RFC2845</refentrytitle>
627 <refentrytitle>RFC1034</refentrytitle>
630 <refentrytitle>RFC2535</refentrytitle>
633 <refentrytitle>RFC2931</refentrytitle>
636 <refentrytitle>named</refentrytitle><manvolnum>8</manvolnum>
639 <refentrytitle>dnssec-keygen</refentrytitle><manvolnum>8</manvolnum>
647 The TSIG key is redundantly stored in two separate files.
648 This is a consequence of nsupdate using the DST library
649 for its cryptographic operations, and may change in future