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-2012 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.
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>
47 <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
54 <holder>Internet Software Consortium.</holder>
60 <command>nsupdate</command>
61 <arg><option>-d</option></arg>
62 <arg><option>-D</option></arg>
64 <arg><option>-g</option></arg>
65 <arg><option>-o</option></arg>
66 <arg><option>-l</option></arg>
67 <arg><option>-y <replaceable class="parameter"><optional>hmac:</optional>keyname:secret</replaceable></option></arg>
68 <arg><option>-k <replaceable class="parameter">keyfile</replaceable></option></arg>
70 <arg><option>-t <replaceable class="parameter">timeout</replaceable></option></arg>
71 <arg><option>-u <replaceable class="parameter">udptimeout</replaceable></option></arg>
72 <arg><option>-r <replaceable class="parameter">udpretries</replaceable></option></arg>
73 <arg><option>-R <replaceable class="parameter">randomdev</replaceable></option></arg>
74 <arg><option>-v</option></arg>
80 <title>DESCRIPTION</title>
81 <para><command>nsupdate</command>
82 is used to submit Dynamic DNS Update requests as defined in RFC 2136
84 This allows resource records to be added or removed from a zone
85 without manually editing the zone file.
86 A single update request can contain requests to add or remove more than
91 Zones that are under dynamic control via
92 <command>nsupdate</command>
93 or a DHCP server should not be edited by hand.
95 conflict with dynamic updates and cause data to be lost.
98 The resource records that are dynamically added or removed with
99 <command>nsupdate</command>
100 have to be in the same zone.
101 Requests are sent to the zone's master server.
102 This is identified by the MNAME field of the zone's SOA record.
108 <command>nsupdate</command>
109 operate in debug mode.
110 This provides tracing information about the update requests that are
111 made and the replies received from the name server.
114 The <option>-D</option> option makes <command>nsupdate</command>
115 report additional debugging information to <option>-d</option>.
118 The <option>-L</option> option with an integer argument of zero or
119 higher sets the logging debug level. If zero, logging is disabled.
122 Transaction signatures can be used to authenticate the Dynamic
123 DNS updates. These use the TSIG resource record type described
124 in RFC 2845 or the SIG(0) record described in RFC 2535 and
125 RFC 2931 or GSS-TSIG as described in RFC 3645. TSIG relies on
126 a shared secret that should only be known to
127 <command>nsupdate</command> and the name server. Currently,
128 the only supported encryption algorithm for TSIG is HMAC-MD5,
129 which is defined in RFC 2104. Once other algorithms are
130 defined for TSIG, applications will need to ensure they select
131 the appropriate algorithm as well as the key when authenticating
132 each other. For instance, suitable <type>key</type> and
133 <type>server</type> statements would be added to
134 <filename>/etc/named.conf</filename> so that the name server
135 can associate the appropriate secret key and algorithm with
136 the IP address of the client application that will be using
137 TSIG authentication. SIG(0) uses public key cryptography.
138 To use a SIG(0) key, the public key must be stored in a KEY
139 record in a zone served by the name server.
140 <command>nsupdate</command> does not read
141 <filename>/etc/named.conf</filename>.
144 GSS-TSIG uses Kerberos credentials. Standard GSS-TSIG mode
145 is switched on with the <option>-g</option> flag. A
146 non-standards-compliant variant of GSS-TSIG used by Windows
147 2000 can be switched on with the <option>-o</option> flag.
149 <para><command>nsupdate</command>
150 uses the <option>-y</option> or <option>-k</option> option
151 to provide the shared secret needed to generate a TSIG record
152 for authenticating Dynamic DNS update requests, default type
153 HMAC-MD5. These options are mutually exclusive.
156 When the <option>-y</option> option is used, a signature is
158 <optional><parameter>hmac:</parameter></optional><parameter>keyname:secret.</parameter>
159 <parameter>keyname</parameter> is the name of the key, and
160 <parameter>secret</parameter> is the base64 encoded shared secret.
161 Use of the <option>-y</option> option is discouraged because the
162 shared secret is supplied as a command line argument in clear text.
163 This may be visible in the output from
165 <refentrytitle>ps</refentrytitle><manvolnum>1</manvolnum>
167 or in a history file maintained by the user's shell.
171 <option>-k</option> option, <command>nsupdate</command> reads
172 the shared secret from the file <parameter>keyfile</parameter>.
173 Keyfiles may be in two formats: a single file containing
174 a <filename>named.conf</filename>-format <command>key</command>
175 statement, which may be generated automatically by
176 <command>ddns-confgen</command>, or a pair of files whose names are
177 of the format <filename>K{name}.+157.+{random}.key</filename> and
178 <filename>K{name}.+157.+{random}.private</filename>, which can be
179 generated by <command>dnssec-keygen</command>.
180 The <option>-k</option> may also be used to specify a SIG(0) key used
181 to authenticate Dynamic DNS update requests. In this case, the key
182 specified is not an HMAC-MD5 key.
185 <command>nsupdate</command> can be run in a local-host only mode
186 using the <option>-l</option> flag. This sets the server address to
187 localhost (disabling the <command>server</command> so that the server
188 address cannot be overridden). Connections to the local server will
189 use a TSIG key found in <filename>/var/run/named/session.key</filename>,
190 which is automatically generated by <command>named</command> if any
191 local master zone has set <command>update-policy</command> to
192 <command>local</command>. The location of this key file can be
193 overridden with the <option>-k</option> option.
196 By default, <command>nsupdate</command>
197 uses UDP to send update requests to the name server unless they are too
198 large to fit in a UDP request in which case TCP will be used.
202 <command>nsupdate</command>
203 use a TCP connection.
204 This may be preferable when a batch of update requests is made.
207 The <option>-p</option> sets the default port number to use for
208 connections to a name server. The default is 53.
211 The <option>-t</option> option sets the maximum time an update request
213 take before it is aborted. The default is 300 seconds. Zero can be
215 to disable the timeout.
218 The <option>-u</option> option sets the UDP retry interval. The default
220 3 seconds. If zero, the interval will be computed from the timeout
222 and number of UDP retries.
225 The <option>-r</option> option sets the number of UDP retries. The
227 3. If zero, only one update request will be made.
230 The <option>-R <replaceable
231 class="parameter">randomdev</replaceable></option> option
232 specifies a source of randomness. If the operating system
233 does not provide a <filename>/dev/random</filename> or
234 equivalent device, the default source of randomness is keyboard
235 input. <filename>randomdev</filename> specifies the name of
236 a character device or file containing random data to be used
237 instead of the default. The special value
238 <filename>keyboard</filename> indicates that keyboard input
239 should be used. This option may be specified multiple times.
244 <title>INPUT FORMAT</title>
245 <para><command>nsupdate</command>
247 <parameter>filename</parameter>
249 Each command is supplied on exactly one line of input.
250 Some commands are for administrative purposes.
251 The others are either update instructions or prerequisite checks on the
252 contents of the zone.
253 These checks set conditions that some name or set of
254 resource records (RRset) either exists or is absent from the zone.
255 These conditions must be met if the entire update request is to succeed.
256 Updates will be rejected if the tests for the prerequisite conditions
260 Every update request consists of zero or more prerequisites
261 and zero or more updates.
262 This allows a suitably authenticated update request to proceed if some
263 specified resource records are present or missing from the zone.
264 A blank input line (or the <command>send</command> command)
266 accumulated commands to be sent as one Dynamic DNS update request to the
270 The command formats and their meaning are as follows:
275 <command>server</command>
276 <arg choice="req">servername</arg>
277 <arg choice="opt">port</arg>
281 Sends all dynamic update requests to the name server
282 <parameter>servername</parameter>.
283 When no server statement is provided,
284 <command>nsupdate</command>
285 will send updates to the master server of the correct zone.
286 The MNAME field of that zone's SOA record will identify the
288 server for that zone.
289 <parameter>port</parameter>
290 is the port number on
291 <parameter>servername</parameter>
292 where the dynamic update requests get sent.
293 If no port number is specified, the default DNS port number of
302 <command>local</command>
303 <arg choice="req">address</arg>
304 <arg choice="opt">port</arg>
308 Sends all dynamic update requests using the local
309 <parameter>address</parameter>.
311 When no local statement is provided,
312 <command>nsupdate</command>
313 will send updates using an address and port chosen by the
315 <parameter>port</parameter>
316 can additionally be used to make requests come from a specific
318 If no port number is specified, the system will assign one.
325 <command>zone</command>
326 <arg choice="req">zonename</arg>
330 Specifies that all updates are to be made to the zone
331 <parameter>zonename</parameter>.
333 <parameter>zone</parameter>
334 statement is provided,
335 <command>nsupdate</command>
336 will attempt determine the correct zone to update based on the
344 <command>class</command>
345 <arg choice="req">classname</arg>
349 Specify the default class.
350 If no <parameter>class</parameter> is specified, the
352 <parameter>IN</parameter>.
359 <command>ttl</command>
360 <arg choice="req">seconds</arg>
364 Specify the default time to live for records to be added.
365 The value <parameter>none</parameter> will clear the default
373 <command>key</command>
374 <arg choice="req">name</arg>
375 <arg choice="req">secret</arg>
379 Specifies that all updates are to be TSIG-signed using the
380 <parameter>keyname</parameter> <parameter>keysecret</parameter> pair.
381 The <command>key</command> command
382 overrides any key specified on the command line via
383 <option>-y</option> or <option>-k</option>.
390 <command>gsstsig</command>
394 Use GSS-TSIG to sign the updated. This is equivalent to
395 specifying <option>-g</option> on the commandline.
402 <command>oldgsstsig</command>
406 Use the Windows 2000 version of GSS-TSIG to sign the updated.
407 This is equivalent to specifying <option>-o</option> on the
415 <command>realm</command>
416 <arg choice="req"><optional>realm_name</optional></arg>
420 When using GSS-TSIG use <parameter>realm_name</parameter> rather
421 than the default realm in <filename>krb5.conf</filename>. If no
422 realm is specified the saved realm is cleared.
429 <command><optional>prereq</optional> nxdomain</command>
430 <arg choice="req">domain-name</arg>
434 Requires that no resource record of any type exists with name
435 <parameter>domain-name</parameter>.
443 <command><optional>prereq</optional> yxdomain</command>
444 <arg choice="req">domain-name</arg>
449 <parameter>domain-name</parameter>
450 exists (has as at least one resource record, of any type).
457 <command><optional>prereq</optional> nxrrset</command>
458 <arg choice="req">domain-name</arg>
459 <arg choice="opt">class</arg>
460 <arg choice="req">type</arg>
464 Requires that no resource record exists of the specified
465 <parameter>type</parameter>,
466 <parameter>class</parameter>
468 <parameter>domain-name</parameter>.
470 <parameter>class</parameter>
471 is omitted, IN (internet) is assumed.
479 <command><optional>prereq</optional> yxrrset</command>
480 <arg choice="req">domain-name</arg>
481 <arg choice="opt">class</arg>
482 <arg choice="req">type</arg>
486 This requires that a resource record of the specified
487 <parameter>type</parameter>,
488 <parameter>class</parameter>
490 <parameter>domain-name</parameter>
493 <parameter>class</parameter>
494 is omitted, IN (internet) is assumed.
501 <command><optional>prereq</optional> yxrrset</command>
502 <arg choice="req">domain-name</arg>
503 <arg choice="opt">class</arg>
504 <arg choice="req">type</arg>
505 <arg choice="req" rep="repeat">data</arg>
510 <parameter>data</parameter>
511 from each set of prerequisites of this form
513 <parameter>type</parameter>,
514 <parameter>class</parameter>,
516 <parameter>domain-name</parameter>
517 are combined to form a set of RRs. This set of RRs must
518 exactly match the set of RRs existing in the zone at the
520 <parameter>type</parameter>,
521 <parameter>class</parameter>,
523 <parameter>domain-name</parameter>.
525 <parameter>data</parameter>
526 are written in the standard text representation of the resource
535 <command><optional>update</optional> del<optional>ete</optional></command>
536 <arg choice="req">domain-name</arg>
537 <arg choice="opt">ttl</arg>
538 <arg choice="opt">class</arg>
539 <arg choice="opt">type <arg choice="opt" rep="repeat">data</arg></arg>
543 Deletes any resource records named
544 <parameter>domain-name</parameter>.
546 <parameter>type</parameter>
548 <parameter>data</parameter>
549 is provided, only matching resource records will be removed.
550 The internet class is assumed if
551 <parameter>class</parameter>
553 <parameter>ttl</parameter>
554 is ignored, and is only allowed for compatibility.
561 <command><optional>update</optional> add</command>
562 <arg choice="req">domain-name</arg>
563 <arg choice="req">ttl</arg>
564 <arg choice="opt">class</arg>
565 <arg choice="req">type</arg>
566 <arg choice="req" rep="repeat">data</arg>
570 Adds a new resource record with the specified
571 <parameter>ttl</parameter>,
572 <parameter>class</parameter>
574 <parameter>data</parameter>.
581 <command>show</command>
585 Displays the current message, containing all of the
587 updates specified since the last send.
594 <command>send</command>
598 Sends the current message. This is equivalent to entering a
606 <command>answer</command>
617 <command>debug</command>
630 Lines beginning with a semicolon are comments and are ignored.
636 <title>EXAMPLES</title>
638 The examples below show how
639 <command>nsupdate</command>
640 could be used to insert and delete resource records from the
641 <type>example.com</type>
643 Notice that the input in each example contains a trailing blank line so
645 a group of commands are sent as one dynamic update request to the
646 master name server for
647 <type>example.com</type>.
651 > update delete oldhost.example.com A
652 > update add newhost.example.com 86400 A 172.16.1.1
658 <type>oldhost.example.com</type>
661 <type>newhost.example.com</type>
662 with IP address 172.16.1.1 is added.
663 The newly-added record has a 1 day TTL (86400 seconds).
666 > prereq nxdomain nickname.example.com
667 > update add nickname.example.com 86400 CNAME somehost.example.com
672 The prerequisite condition gets the name server to check that there
673 are no resource records of any type for
674 <type>nickname.example.com</type>.
676 If there are, the update request fails.
677 If this name does not exist, a CNAME for it is added.
678 This ensures that when the CNAME is added, it cannot conflict with the
679 long-standing rule in RFC 1034 that a name must not exist as any other
680 record type if it exists as a CNAME.
681 (The rule has been updated for DNSSEC in RFC 2535 to allow CNAMEs to have
682 RRSIG, DNSKEY and NSEC records.)
691 <term><constant>/etc/resolv.conf</constant></term>
694 used to identify default name server
700 <term><constant>/var/run/named/session.key</constant></term>
703 sets the default TSIG key for use in local-only mode
709 <term><constant>K{name}.+157.+{random}.key</constant></term>
712 base-64 encoding of HMAC-MD5 key created by
714 <refentrytitle>dnssec-keygen</refentrytitle><manvolnum>8</manvolnum>
721 <term><constant>K{name}.+157.+{random}.private</constant></term>
724 base-64 encoding of HMAC-MD5 key created by
726 <refentrytitle>dnssec-keygen</refentrytitle><manvolnum>8</manvolnum>
736 <title>SEE ALSO</title>
738 <citetitle>RFC 2136</citetitle>,
739 <citetitle>RFC 3007</citetitle>,
740 <citetitle>RFC 2104</citetitle>,
741 <citetitle>RFC 2845</citetitle>,
742 <citetitle>RFC 1034</citetitle>,
743 <citetitle>RFC 2535</citetitle>,
744 <citetitle>RFC 2931</citetitle>,
746 <refentrytitle>named</refentrytitle><manvolnum>8</manvolnum>
749 <refentrytitle>ddns-confgen</refentrytitle><manvolnum>8</manvolnum>
752 <refentrytitle>dnssec-keygen</refentrytitle><manvolnum>8</manvolnum>
760 The TSIG key is redundantly stored in two separate files.
761 This is a consequence of nsupdate using the DST library
762 for its cryptographic operations, and may change in future