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.41 2009/10/16 02:59:41 each Exp -->
22 <refentry id="man.nsupdate">
24 <date>Aug 25, 2009</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>-l</option></arg>
64 <arg><option>-y <replaceable class="parameter"><optional>hmac:</optional>keyname:secret</replaceable></option></arg>
65 <arg><option>-k <replaceable class="parameter">keyfile</replaceable></option></arg>
67 <arg><option>-t <replaceable class="parameter">timeout</replaceable></option></arg>
68 <arg><option>-u <replaceable class="parameter">udptimeout</replaceable></option></arg>
69 <arg><option>-r <replaceable class="parameter">udpretries</replaceable></option></arg>
70 <arg><option>-R <replaceable class="parameter">randomdev</replaceable></option></arg>
71 <arg><option>-v</option></arg>
77 <title>DESCRIPTION</title>
78 <para><command>nsupdate</command>
79 is used to submit Dynamic DNS Update requests as defined in RFC 2136
81 This allows resource records to be added or removed from a zone
82 without manually editing the zone file.
83 A single update request can contain requests to add or remove more than
88 Zones that are under dynamic control via
89 <command>nsupdate</command>
90 or a DHCP server should not be edited by hand.
92 conflict with dynamic updates and cause data to be lost.
95 The resource records that are dynamically added or removed with
96 <command>nsupdate</command>
97 have to be in the same zone.
98 Requests are sent to the zone's master server.
99 This is identified by the MNAME field of the zone's SOA record.
105 <command>nsupdate</command>
106 operate in debug mode.
107 This provides tracing information about the update requests that are
108 made and the replies received from the name server.
111 The <option>-D</option> option makes <command>nsupdate</command>
112 report additional debugging information to <option>-d</option>.
115 The <option>-L</option> option with an integer argument of zero or
116 higher sets the logging debug level. If zero, logging is disabled.
119 Transaction signatures can be used to authenticate the Dynamic
120 DNS updates. These use the TSIG resource record type described
121 in RFC 2845 or the SIG(0) record described in RFC 2535 and
122 RFC 2931 or GSS-TSIG as described in RFC 3645. TSIG relies on
123 a shared secret that should only be known to
124 <command>nsupdate</command> and the name server. Currently,
125 the only supported encryption algorithm for TSIG is HMAC-MD5,
126 which is defined in RFC 2104. Once other algorithms are
127 defined for TSIG, applications will need to ensure they select
128 the appropriate algorithm as well as the key when authenticating
129 each other. For instance, suitable <type>key</type> and
130 <type>server</type> statements would be added to
131 <filename>/etc/named.conf</filename> so that the name server
132 can associate the appropriate secret key and algorithm with
133 the IP address of the client application that will be using
134 TSIG authentication. SIG(0) uses public key cryptography.
135 To use a SIG(0) key, the public key must be stored in a KEY
136 record in a zone served by the name server.
137 <command>nsupdate</command> does not read
138 <filename>/etc/named.conf</filename>.
141 GSS-TSIG uses Kerberos credentials. Standard GSS-TSIG mode
142 is switched on with the <option>-g</option> flag. A
143 non-standards-compliant variant of GSS-TSIG used by Windows
144 2000 can be switched on with the <option>-o</option> flag.
146 <para><command>nsupdate</command>
147 uses the <option>-y</option> or <option>-k</option> option
148 to provide the shared secret needed to generate a TSIG record
149 for authenticating Dynamic DNS update requests, default type
150 HMAC-MD5. These options are mutually exclusive.
153 When the <option>-y</option> option is used, a signature is
155 <optional><parameter>hmac:</parameter></optional><parameter>keyname:secret.</parameter>
156 <parameter>keyname</parameter> is the name of the key, and
157 <parameter>secret</parameter> is the base64 encoded shared secret.
158 Use of the <option>-y</option> option is discouraged because the
159 shared secret is supplied as a command line argument in clear text.
160 This may be visible in the output from
162 <refentrytitle>ps</refentrytitle><manvolnum>1</manvolnum>
164 or in a history file maintained by the user's shell.
168 <option>-k</option> option, <command>nsupdate</command> reads
169 the shared secret from the file <parameter>keyfile</parameter>.
170 Keyfiles may be in two formats: a single file containing
171 a <filename>named.conf</filename>-format <command>key</command>
172 statement, which may be generated automatically by
173 <command>ddns-confgen</command>, or a pair of files whose names are
174 of the format <filename>K{name}.+157.+{random}.key</filename> and
175 <filename>K{name}.+157.+{random}.private</filename>, which can be
176 generated by <command>dnssec-keygen</command>.
177 The <option>-k</option> may also be used to specify a SIG(0) key used
178 to authenticate Dynamic DNS update requests. In this case, the key
179 specified is not an HMAC-MD5 key.
182 <command>nsupdate</command> can be run in a local-host only mode
183 using the <option>-l</option> flag. This sets the server address to
184 localhost (disabling the <command>server</command> so that the server
185 address cannot be overridden). Connections to the local server will
186 use a TSIG key found in <filename>/var/run/named/ddns.key</filename>,
187 which is automatically generated by <command>named</command> if any
188 local master zone has set <command>update-policy</command> to
189 <command>local</command>. The location of this key file can be
190 overridden with the <option>-k</option> option.
193 By default, <command>nsupdate</command>
194 uses UDP to send update requests to the name server unless they are too
195 large to fit in a UDP request in which case TCP will be used.
199 <command>nsupdate</command>
200 use a TCP connection.
201 This may be preferable when a batch of update requests is made.
204 The <option>-p</option> sets the default port number to use for
205 connections to a name server. The default is 53.
208 The <option>-t</option> option sets the maximum time an update request
210 take before it is aborted. The default is 300 seconds. Zero can be
212 to disable the timeout.
215 The <option>-u</option> option sets the UDP retry interval. The default
217 3 seconds. If zero, the interval will be computed from the timeout
219 and number of UDP retries.
222 The <option>-r</option> option sets the number of UDP retries. The
224 3. If zero, only one update request will be made.
227 The <option>-R <replaceable
228 class="parameter">randomdev</replaceable></option> option
229 specifies a source of randomness. If the operating system
230 does not provide a <filename>/dev/random</filename> or
231 equivalent device, the default source of randomness is keyboard
232 input. <filename>randomdev</filename> specifies the name of
233 a character device or file containing random data to be used
234 instead of the default. The special value
235 <filename>keyboard</filename> indicates that keyboard input
236 should be used. This option may be specified multiple times.
241 <title>INPUT FORMAT</title>
242 <para><command>nsupdate</command>
244 <parameter>filename</parameter>
246 Each command is supplied on exactly one line of input.
247 Some commands are for administrative purposes.
248 The others are either update instructions or prerequisite checks on the
249 contents of the zone.
250 These checks set conditions that some name or set of
251 resource records (RRset) either exists or is absent from the zone.
252 These conditions must be met if the entire update request is to succeed.
253 Updates will be rejected if the tests for the prerequisite conditions
257 Every update request consists of zero or more prerequisites
258 and zero or more updates.
259 This allows a suitably authenticated update request to proceed if some
260 specified resource records are present or missing from the zone.
261 A blank input line (or the <command>send</command> command)
263 accumulated commands to be sent as one Dynamic DNS update request to the
267 The command formats and their meaning are as follows:
272 <command>server</command>
273 <arg choice="req">servername</arg>
274 <arg choice="opt">port</arg>
278 Sends all dynamic update requests to the name server
279 <parameter>servername</parameter>.
280 When no server statement is provided,
281 <command>nsupdate</command>
282 will send updates to the master server of the correct zone.
283 The MNAME field of that zone's SOA record will identify the
285 server for that zone.
286 <parameter>port</parameter>
287 is the port number on
288 <parameter>servername</parameter>
289 where the dynamic update requests get sent.
290 If no port number is specified, the default DNS port number of
299 <command>local</command>
300 <arg choice="req">address</arg>
301 <arg choice="opt">port</arg>
305 Sends all dynamic update requests using the local
306 <parameter>address</parameter>.
308 When no local statement is provided,
309 <command>nsupdate</command>
310 will send updates using an address and port chosen by the
312 <parameter>port</parameter>
313 can additionally be used to make requests come from a specific
315 If no port number is specified, the system will assign one.
322 <command>zone</command>
323 <arg choice="req">zonename</arg>
327 Specifies that all updates are to be made to the zone
328 <parameter>zonename</parameter>.
330 <parameter>zone</parameter>
331 statement is provided,
332 <command>nsupdate</command>
333 will attempt determine the correct zone to update based on the
341 <command>class</command>
342 <arg choice="req">classname</arg>
346 Specify the default class.
347 If no <parameter>class</parameter> is specified, the
349 <parameter>IN</parameter>.
356 <command>ttl</command>
357 <arg choice="req">seconds</arg>
361 Specify the default time to live for records to be added.
362 The value <parameter>none</parameter> will clear the default
370 <command>key</command>
371 <arg choice="req">name</arg>
372 <arg choice="req">secret</arg>
376 Specifies that all updates are to be TSIG-signed using the
377 <parameter>keyname</parameter> <parameter>keysecret</parameter> pair.
378 The <command>key</command> command
379 overrides any key specified on the command line via
380 <option>-y</option> or <option>-k</option>.
387 <command>prereq nxdomain</command>
388 <arg choice="req">domain-name</arg>
392 Requires that no resource record of any type exists with name
393 <parameter>domain-name</parameter>.
401 <command>prereq yxdomain</command>
402 <arg choice="req">domain-name</arg>
407 <parameter>domain-name</parameter>
408 exists (has as at least one resource record, of any type).
415 <command>prereq nxrrset</command>
416 <arg choice="req">domain-name</arg>
417 <arg choice="opt">class</arg>
418 <arg choice="req">type</arg>
422 Requires that no resource record exists of the specified
423 <parameter>type</parameter>,
424 <parameter>class</parameter>
426 <parameter>domain-name</parameter>.
428 <parameter>class</parameter>
429 is omitted, IN (internet) is assumed.
437 <command>prereq yxrrset</command>
438 <arg choice="req">domain-name</arg>
439 <arg choice="opt">class</arg>
440 <arg choice="req">type</arg>
444 This requires that a resource record of the specified
445 <parameter>type</parameter>,
446 <parameter>class</parameter>
448 <parameter>domain-name</parameter>
451 <parameter>class</parameter>
452 is omitted, IN (internet) is assumed.
459 <command>prereq yxrrset</command>
460 <arg choice="req">domain-name</arg>
461 <arg choice="opt">class</arg>
462 <arg choice="req">type</arg>
463 <arg choice="req" rep="repeat">data</arg>
468 <parameter>data</parameter>
469 from each set of prerequisites of this form
471 <parameter>type</parameter>,
472 <parameter>class</parameter>,
474 <parameter>domain-name</parameter>
475 are combined to form a set of RRs. This set of RRs must
476 exactly match the set of RRs existing in the zone at the
478 <parameter>type</parameter>,
479 <parameter>class</parameter>,
481 <parameter>domain-name</parameter>.
483 <parameter>data</parameter>
484 are written in the standard text representation of the resource
493 <command>update delete</command>
494 <arg choice="req">domain-name</arg>
495 <arg choice="opt">ttl</arg>
496 <arg choice="opt">class</arg>
497 <arg choice="opt">type <arg choice="opt" rep="repeat">data</arg></arg>
501 Deletes any resource records named
502 <parameter>domain-name</parameter>.
504 <parameter>type</parameter>
506 <parameter>data</parameter>
507 is provided, only matching resource records will be removed.
508 The internet class is assumed if
509 <parameter>class</parameter>
511 <parameter>ttl</parameter>
512 is ignored, and is only allowed for compatibility.
519 <command>update add</command>
520 <arg choice="req">domain-name</arg>
521 <arg choice="req">ttl</arg>
522 <arg choice="opt">class</arg>
523 <arg choice="req">type</arg>
524 <arg choice="req" rep="repeat">data</arg>
528 Adds a new resource record with the specified
529 <parameter>ttl</parameter>,
530 <parameter>class</parameter>
532 <parameter>data</parameter>.
539 <command>show</command>
543 Displays the current message, containing all of the
545 updates specified since the last send.
552 <command>send</command>
556 Sends the current message. This is equivalent to entering a
564 <command>answer</command>
575 <command>debug</command>
588 Lines beginning with a semicolon are comments and are ignored.
594 <title>EXAMPLES</title>
596 The examples below show how
597 <command>nsupdate</command>
598 could be used to insert and delete resource records from the
599 <type>example.com</type>
601 Notice that the input in each example contains a trailing blank line so
603 a group of commands are sent as one dynamic update request to the
604 master name server for
605 <type>example.com</type>.
609 > update delete oldhost.example.com A
610 > update add newhost.example.com 86400 A 172.16.1.1
616 <type>oldhost.example.com</type>
619 <type>newhost.example.com</type>
620 with IP address 172.16.1.1 is added.
621 The newly-added record has a 1 day TTL (86400 seconds).
624 > prereq nxdomain nickname.example.com
625 > update add nickname.example.com 86400 CNAME somehost.example.com
630 The prerequisite condition gets the name server to check that there
631 are no resource records of any type for
632 <type>nickname.example.com</type>.
634 If there are, the update request fails.
635 If this name does not exist, a CNAME for it is added.
636 This ensures that when the CNAME is added, it cannot conflict with the
637 long-standing rule in RFC 1034 that a name must not exist as any other
638 record type if it exists as a CNAME.
639 (The rule has been updated for DNSSEC in RFC 2535 to allow CNAMEs to have
640 RRSIG, DNSKEY and NSEC records.)
649 <term><constant>/etc/resolv.conf</constant></term>
652 used to identify default name server
658 <term><constant>/var/run/named/ddns.key</constant></term>
661 sets the default TSIG key for use in local-only mode
667 <term><constant>K{name}.+157.+{random}.key</constant></term>
670 base-64 encoding of HMAC-MD5 key created by
672 <refentrytitle>dnssec-keygen</refentrytitle><manvolnum>8</manvolnum>
679 <term><constant>K{name}.+157.+{random}.private</constant></term>
682 base-64 encoding of HMAC-MD5 key created by
684 <refentrytitle>dnssec-keygen</refentrytitle><manvolnum>8</manvolnum>
694 <title>SEE ALSO</title>
696 <citetitle>RFC 2136</citetitle>,
697 <citetitle>RFC 3007</citetitle>,
698 <citetitle>RFC 2104</citetitle>,
699 <citetitle>RFC 2845</citetitle>,
700 <citetitle>RFC 1034</citetitle>,
701 <citetitle>RFC 2535</citetitle>,
702 <citetitle>RFC 2931</citetitle>,
704 <refentrytitle>named</refentrytitle><manvolnum>8</manvolnum>
707 <refentrytitle>ddns-confgen</refentrytitle><manvolnum>8</manvolnum>
710 <refentrytitle>dnssec-keygen</refentrytitle><manvolnum>8</manvolnum>
718 The TSIG key is redundantly stored in two separate files.
719 This is a consequence of nsupdate using the DST library
720 for its cryptographic operations, and may change in future