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-2010 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.44 2010-07-09 23:46:51 tbox 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>
45 <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
52 <holder>Internet Software Consortium.</holder>
58 <command>nsupdate</command>
59 <arg><option>-d</option></arg>
60 <arg><option>-D</option></arg>
62 <arg><option>-g</option></arg>
63 <arg><option>-o</option></arg>
64 <arg><option>-l</option></arg>
65 <arg><option>-y <replaceable class="parameter"><optional>hmac:</optional>keyname:secret</replaceable></option></arg>
66 <arg><option>-k <replaceable class="parameter">keyfile</replaceable></option></arg>
68 <arg><option>-t <replaceable class="parameter">timeout</replaceable></option></arg>
69 <arg><option>-u <replaceable class="parameter">udptimeout</replaceable></option></arg>
70 <arg><option>-r <replaceable class="parameter">udpretries</replaceable></option></arg>
71 <arg><option>-R <replaceable class="parameter">randomdev</replaceable></option></arg>
72 <arg><option>-v</option></arg>
78 <title>DESCRIPTION</title>
79 <para><command>nsupdate</command>
80 is used to submit Dynamic DNS Update requests as defined in RFC 2136
82 This allows resource records to be added or removed from a zone
83 without manually editing the zone file.
84 A single update request can contain requests to add or remove more than
89 Zones that are under dynamic control via
90 <command>nsupdate</command>
91 or a DHCP server should not be edited by hand.
93 conflict with dynamic updates and cause data to be lost.
96 The resource records that are dynamically added or removed with
97 <command>nsupdate</command>
98 have to be in the same zone.
99 Requests are sent to the zone's master server.
100 This is identified by the MNAME field of the zone's SOA record.
106 <command>nsupdate</command>
107 operate in debug mode.
108 This provides tracing information about the update requests that are
109 made and the replies received from the name server.
112 The <option>-D</option> option makes <command>nsupdate</command>
113 report additional debugging information to <option>-d</option>.
116 The <option>-L</option> option with an integer argument of zero or
117 higher sets the logging debug level. If zero, logging is disabled.
120 Transaction signatures can be used to authenticate the Dynamic
121 DNS updates. These use the TSIG resource record type described
122 in RFC 2845 or the SIG(0) record described in RFC 2535 and
123 RFC 2931 or GSS-TSIG as described in RFC 3645. TSIG relies on
124 a shared secret that should only be known to
125 <command>nsupdate</command> and the name server. Currently,
126 the only supported encryption algorithm for TSIG is HMAC-MD5,
127 which is defined in RFC 2104. Once other algorithms are
128 defined for TSIG, applications will need to ensure they select
129 the appropriate algorithm as well as the key when authenticating
130 each other. For instance, suitable <type>key</type> and
131 <type>server</type> statements would be added to
132 <filename>/etc/named.conf</filename> so that the name server
133 can associate the appropriate secret key and algorithm with
134 the IP address of the client application that will be using
135 TSIG authentication. SIG(0) uses public key cryptography.
136 To use a SIG(0) key, the public key must be stored in a KEY
137 record in a zone served by the name server.
138 <command>nsupdate</command> does not read
139 <filename>/etc/named.conf</filename>.
142 GSS-TSIG uses Kerberos credentials. Standard GSS-TSIG mode
143 is switched on with the <option>-g</option> flag. A
144 non-standards-compliant variant of GSS-TSIG used by Windows
145 2000 can be switched on with the <option>-o</option> flag.
147 <para><command>nsupdate</command>
148 uses the <option>-y</option> or <option>-k</option> option
149 to provide the shared secret needed to generate a TSIG record
150 for authenticating Dynamic DNS update requests, default type
151 HMAC-MD5. These options are mutually exclusive.
154 When the <option>-y</option> option is used, a signature is
156 <optional><parameter>hmac:</parameter></optional><parameter>keyname:secret.</parameter>
157 <parameter>keyname</parameter> is the name of the key, and
158 <parameter>secret</parameter> is the base64 encoded shared secret.
159 Use of the <option>-y</option> option is discouraged because the
160 shared secret is supplied as a command line argument in clear text.
161 This may be visible in the output from
163 <refentrytitle>ps</refentrytitle><manvolnum>1</manvolnum>
165 or in a history file maintained by the user's shell.
169 <option>-k</option> option, <command>nsupdate</command> reads
170 the shared secret from the file <parameter>keyfile</parameter>.
171 Keyfiles may be in two formats: a single file containing
172 a <filename>named.conf</filename>-format <command>key</command>
173 statement, which may be generated automatically by
174 <command>ddns-confgen</command>, or a pair of files whose names are
175 of the format <filename>K{name}.+157.+{random}.key</filename> and
176 <filename>K{name}.+157.+{random}.private</filename>, which can be
177 generated by <command>dnssec-keygen</command>.
178 The <option>-k</option> may also be used to specify a SIG(0) key used
179 to authenticate Dynamic DNS update requests. In this case, the key
180 specified is not an HMAC-MD5 key.
183 <command>nsupdate</command> can be run in a local-host only mode
184 using the <option>-l</option> flag. This sets the server address to
185 localhost (disabling the <command>server</command> so that the server
186 address cannot be overridden). Connections to the local server will
187 use a TSIG key found in <filename>/var/run/named/session.key</filename>,
188 which is automatically generated by <command>named</command> if any
189 local master zone has set <command>update-policy</command> to
190 <command>local</command>. The location of this key file can be
191 overridden with the <option>-k</option> option.
194 By default, <command>nsupdate</command>
195 uses UDP to send update requests to the name server unless they are too
196 large to fit in a UDP request in which case TCP will be used.
200 <command>nsupdate</command>
201 use a TCP connection.
202 This may be preferable when a batch of update requests is made.
205 The <option>-p</option> sets the default port number to use for
206 connections to a name server. The default is 53.
209 The <option>-t</option> option sets the maximum time an update request
211 take before it is aborted. The default is 300 seconds. Zero can be
213 to disable the timeout.
216 The <option>-u</option> option sets the UDP retry interval. The default
218 3 seconds. If zero, the interval will be computed from the timeout
220 and number of UDP retries.
223 The <option>-r</option> option sets the number of UDP retries. The
225 3. If zero, only one update request will be made.
228 The <option>-R <replaceable
229 class="parameter">randomdev</replaceable></option> option
230 specifies a source of randomness. If the operating system
231 does not provide a <filename>/dev/random</filename> or
232 equivalent device, the default source of randomness is keyboard
233 input. <filename>randomdev</filename> specifies the name of
234 a character device or file containing random data to be used
235 instead of the default. The special value
236 <filename>keyboard</filename> indicates that keyboard input
237 should be used. This option may be specified multiple times.
242 <title>INPUT FORMAT</title>
243 <para><command>nsupdate</command>
245 <parameter>filename</parameter>
247 Each command is supplied on exactly one line of input.
248 Some commands are for administrative purposes.
249 The others are either update instructions or prerequisite checks on the
250 contents of the zone.
251 These checks set conditions that some name or set of
252 resource records (RRset) either exists or is absent from the zone.
253 These conditions must be met if the entire update request is to succeed.
254 Updates will be rejected if the tests for the prerequisite conditions
258 Every update request consists of zero or more prerequisites
259 and zero or more updates.
260 This allows a suitably authenticated update request to proceed if some
261 specified resource records are present or missing from the zone.
262 A blank input line (or the <command>send</command> command)
264 accumulated commands to be sent as one Dynamic DNS update request to the
268 The command formats and their meaning are as follows:
273 <command>server</command>
274 <arg choice="req">servername</arg>
275 <arg choice="opt">port</arg>
279 Sends all dynamic update requests to the name server
280 <parameter>servername</parameter>.
281 When no server statement is provided,
282 <command>nsupdate</command>
283 will send updates to the master server of the correct zone.
284 The MNAME field of that zone's SOA record will identify the
286 server for that zone.
287 <parameter>port</parameter>
288 is the port number on
289 <parameter>servername</parameter>
290 where the dynamic update requests get sent.
291 If no port number is specified, the default DNS port number of
300 <command>local</command>
301 <arg choice="req">address</arg>
302 <arg choice="opt">port</arg>
306 Sends all dynamic update requests using the local
307 <parameter>address</parameter>.
309 When no local statement is provided,
310 <command>nsupdate</command>
311 will send updates using an address and port chosen by the
313 <parameter>port</parameter>
314 can additionally be used to make requests come from a specific
316 If no port number is specified, the system will assign one.
323 <command>zone</command>
324 <arg choice="req">zonename</arg>
328 Specifies that all updates are to be made to the zone
329 <parameter>zonename</parameter>.
331 <parameter>zone</parameter>
332 statement is provided,
333 <command>nsupdate</command>
334 will attempt determine the correct zone to update based on the
342 <command>class</command>
343 <arg choice="req">classname</arg>
347 Specify the default class.
348 If no <parameter>class</parameter> is specified, the
350 <parameter>IN</parameter>.
357 <command>ttl</command>
358 <arg choice="req">seconds</arg>
362 Specify the default time to live for records to be added.
363 The value <parameter>none</parameter> will clear the default
371 <command>key</command>
372 <arg choice="req">name</arg>
373 <arg choice="req">secret</arg>
377 Specifies that all updates are to be TSIG-signed using the
378 <parameter>keyname</parameter> <parameter>keysecret</parameter> pair.
379 The <command>key</command> command
380 overrides any key specified on the command line via
381 <option>-y</option> or <option>-k</option>.
388 <command>gsstsig</command>
392 Use GSS-TSIG to sign the updated. This is equivalent to
393 specifying <option>-g</option> on the commandline.
400 <command>oldgsstsig</command>
404 Use the Windows 2000 version of GSS-TSIG to sign the updated.
405 This is equivalent to specifying <option>-o</option> on the
413 <command>realm</command>
414 <arg choice="req"><optional>realm_name</optional></arg>
418 When using GSS-TSIG use <parameter>realm_name</parameter> rather
419 than the default realm in <filename>krb5.conf</filename>. If no
420 realm is specified the saved realm is cleared.
427 <command>prereq nxdomain</command>
428 <arg choice="req">domain-name</arg>
432 Requires that no resource record of any type exists with name
433 <parameter>domain-name</parameter>.
441 <command>prereq yxdomain</command>
442 <arg choice="req">domain-name</arg>
447 <parameter>domain-name</parameter>
448 exists (has as at least one resource record, of any type).
455 <command>prereq nxrrset</command>
456 <arg choice="req">domain-name</arg>
457 <arg choice="opt">class</arg>
458 <arg choice="req">type</arg>
462 Requires that no resource record exists of the specified
463 <parameter>type</parameter>,
464 <parameter>class</parameter>
466 <parameter>domain-name</parameter>.
468 <parameter>class</parameter>
469 is omitted, IN (internet) is assumed.
477 <command>prereq yxrrset</command>
478 <arg choice="req">domain-name</arg>
479 <arg choice="opt">class</arg>
480 <arg choice="req">type</arg>
484 This requires that a resource record of the specified
485 <parameter>type</parameter>,
486 <parameter>class</parameter>
488 <parameter>domain-name</parameter>
491 <parameter>class</parameter>
492 is omitted, IN (internet) is assumed.
499 <command>prereq yxrrset</command>
500 <arg choice="req">domain-name</arg>
501 <arg choice="opt">class</arg>
502 <arg choice="req">type</arg>
503 <arg choice="req" rep="repeat">data</arg>
508 <parameter>data</parameter>
509 from each set of prerequisites of this form
511 <parameter>type</parameter>,
512 <parameter>class</parameter>,
514 <parameter>domain-name</parameter>
515 are combined to form a set of RRs. This set of RRs must
516 exactly match the set of RRs existing in the zone at the
518 <parameter>type</parameter>,
519 <parameter>class</parameter>,
521 <parameter>domain-name</parameter>.
523 <parameter>data</parameter>
524 are written in the standard text representation of the resource
533 <command>update delete</command>
534 <arg choice="req">domain-name</arg>
535 <arg choice="opt">ttl</arg>
536 <arg choice="opt">class</arg>
537 <arg choice="opt">type <arg choice="opt" rep="repeat">data</arg></arg>
541 Deletes any resource records named
542 <parameter>domain-name</parameter>.
544 <parameter>type</parameter>
546 <parameter>data</parameter>
547 is provided, only matching resource records will be removed.
548 The internet class is assumed if
549 <parameter>class</parameter>
551 <parameter>ttl</parameter>
552 is ignored, and is only allowed for compatibility.
559 <command>update add</command>
560 <arg choice="req">domain-name</arg>
561 <arg choice="req">ttl</arg>
562 <arg choice="opt">class</arg>
563 <arg choice="req">type</arg>
564 <arg choice="req" rep="repeat">data</arg>
568 Adds a new resource record with the specified
569 <parameter>ttl</parameter>,
570 <parameter>class</parameter>
572 <parameter>data</parameter>.
579 <command>show</command>
583 Displays the current message, containing all of the
585 updates specified since the last send.
592 <command>send</command>
596 Sends the current message. This is equivalent to entering a
604 <command>answer</command>
615 <command>debug</command>
628 Lines beginning with a semicolon are comments and are ignored.
634 <title>EXAMPLES</title>
636 The examples below show how
637 <command>nsupdate</command>
638 could be used to insert and delete resource records from the
639 <type>example.com</type>
641 Notice that the input in each example contains a trailing blank line so
643 a group of commands are sent as one dynamic update request to the
644 master name server for
645 <type>example.com</type>.
649 > update delete oldhost.example.com A
650 > update add newhost.example.com 86400 A 172.16.1.1
656 <type>oldhost.example.com</type>
659 <type>newhost.example.com</type>
660 with IP address 172.16.1.1 is added.
661 The newly-added record has a 1 day TTL (86400 seconds).
664 > prereq nxdomain nickname.example.com
665 > update add nickname.example.com 86400 CNAME somehost.example.com
670 The prerequisite condition gets the name server to check that there
671 are no resource records of any type for
672 <type>nickname.example.com</type>.
674 If there are, the update request fails.
675 If this name does not exist, a CNAME for it is added.
676 This ensures that when the CNAME is added, it cannot conflict with the
677 long-standing rule in RFC 1034 that a name must not exist as any other
678 record type if it exists as a CNAME.
679 (The rule has been updated for DNSSEC in RFC 2535 to allow CNAMEs to have
680 RRSIG, DNSKEY and NSEC records.)
689 <term><constant>/etc/resolv.conf</constant></term>
692 used to identify default name server
698 <term><constant>/var/run/named/session.key</constant></term>
701 sets the default TSIG key for use in local-only mode
707 <term><constant>K{name}.+157.+{random}.key</constant></term>
710 base-64 encoding of HMAC-MD5 key created by
712 <refentrytitle>dnssec-keygen</refentrytitle><manvolnum>8</manvolnum>
719 <term><constant>K{name}.+157.+{random}.private</constant></term>
722 base-64 encoding of HMAC-MD5 key created by
724 <refentrytitle>dnssec-keygen</refentrytitle><manvolnum>8</manvolnum>
734 <title>SEE ALSO</title>
736 <citetitle>RFC 2136</citetitle>,
737 <citetitle>RFC 3007</citetitle>,
738 <citetitle>RFC 2104</citetitle>,
739 <citetitle>RFC 2845</citetitle>,
740 <citetitle>RFC 1034</citetitle>,
741 <citetitle>RFC 2535</citetitle>,
742 <citetitle>RFC 2931</citetitle>,
744 <refentrytitle>named</refentrytitle><manvolnum>8</manvolnum>
747 <refentrytitle>ddns-confgen</refentrytitle><manvolnum>8</manvolnum>
750 <refentrytitle>dnssec-keygen</refentrytitle><manvolnum>8</manvolnum>
758 The TSIG key is redundantly stored in two separate files.
759 This is a consequence of nsupdate using the DST library
760 for its cryptographic operations, and may change in future