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, 2014 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 <refentry id="man.nsupdate">
23 <date>April 18, 2014</date>
26 <refentrytitle><application>nsupdate</application></refentrytitle>
27 <manvolnum>1</manvolnum>
28 <refmiscinfo>BIND9</refmiscinfo>
31 <refname><application>nsupdate</application></refname>
32 <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>
75 <arg><option>-V</option></arg>
81 <title>DESCRIPTION</title>
82 <para><command>nsupdate</command>
83 is used to submit Dynamic DNS Update requests as defined in RFC 2136
85 This allows resource records to be added or removed from a zone
86 without manually editing the zone file.
87 A single update request can contain requests to add or remove more than
92 Zones that are under dynamic control via
93 <command>nsupdate</command>
94 or a DHCP server should not be edited by hand.
96 conflict with dynamic updates and cause data to be lost.
99 The resource records that are dynamically added or removed with
100 <command>nsupdate</command>
101 have to be in the same zone.
102 Requests are sent to the zone's master server.
103 This is identified by the MNAME field of the zone's SOA record.
109 <command>nsupdate</command>
110 operate in debug mode.
111 This provides tracing information about the update requests that are
112 made and the replies received from the name server.
115 The <option>-D</option> option makes <command>nsupdate</command>
116 report additional debugging information to <option>-d</option>.
119 The <option>-L</option> option with an integer argument of zero or
120 higher sets the logging debug level. If zero, logging is disabled.
123 Transaction signatures can be used to authenticate the Dynamic
124 DNS updates. These use the TSIG resource record type described
125 in RFC 2845 or the SIG(0) record described in RFC 2535 and
126 RFC 2931 or GSS-TSIG as described in RFC 3645. TSIG relies on
127 a shared secret that should only be known to
128 <command>nsupdate</command> and the name server. Currently,
129 the only supported encryption algorithm for TSIG is HMAC-MD5,
130 which is defined in RFC 2104. Once other algorithms are
131 defined for TSIG, applications will need to ensure they select
132 the appropriate algorithm as well as the key when authenticating
133 each other. For instance, suitable <type>key</type> and
134 <type>server</type> statements would be added to
135 <filename>/etc/named.conf</filename> so that the name server
136 can associate the appropriate secret key and algorithm with
137 the IP address of the client application that will be using
138 TSIG authentication. SIG(0) uses public key cryptography.
139 To use a SIG(0) key, the public key must be stored in a KEY
140 record in a zone served by the name server.
141 <command>nsupdate</command> does not read
142 <filename>/etc/named.conf</filename>.
145 GSS-TSIG uses Kerberos credentials. Standard GSS-TSIG mode
146 is switched on with the <option>-g</option> flag. A
147 non-standards-compliant variant of GSS-TSIG used by Windows
148 2000 can be switched on with the <option>-o</option> flag.
150 <para><command>nsupdate</command>
151 uses the <option>-y</option> or <option>-k</option> option
152 to provide the shared secret needed to generate a TSIG record
153 for authenticating Dynamic DNS update requests, default type
154 HMAC-MD5. These options are mutually exclusive.
157 When the <option>-y</option> option is used, a signature is
159 <optional><parameter>hmac:</parameter></optional><parameter>keyname:secret.</parameter>
160 <parameter>keyname</parameter> is the name of the key, and
161 <parameter>secret</parameter> is the base64 encoded shared secret.
162 <parameter>hmac</parameter> is the name of the key algorithm;
163 valid choices are <literal>hmac-md5</literal>,
164 <literal>hmac-sha1</literal>, <literal>hmac-sha224</literal>,
165 <literal>hmac-sha256</literal>, <literal>hmac-sha384</literal>, or
166 <literal>hmac-sha512</literal>. If <parameter>hmac</parameter>
167 is not specified, the default is <literal>hmac-md5</literal>.
168 NOTE: Use of the <option>-y</option> option is discouraged because the
169 shared secret is supplied as a command line argument in clear text.
170 This may be visible in the output from
172 <refentrytitle>ps</refentrytitle><manvolnum>1</manvolnum>
174 or in a history file maintained by the user's shell.
178 <option>-k</option> option, <command>nsupdate</command> reads
179 the shared secret from the file <parameter>keyfile</parameter>.
180 Keyfiles may be in two formats: a single file containing
181 a <filename>named.conf</filename>-format <command>key</command>
182 statement, which may be generated automatically by
183 <command>ddns-confgen</command>, or a pair of files whose names are
184 of the format <filename>K{name}.+157.+{random}.key</filename> and
185 <filename>K{name}.+157.+{random}.private</filename>, which can be
186 generated by <command>dnssec-keygen</command>.
187 The <option>-k</option> may also be used to specify a SIG(0) key used
188 to authenticate Dynamic DNS update requests. In this case, the key
189 specified is not an HMAC-MD5 key.
192 <command>nsupdate</command> can be run in a local-host only mode
193 using the <option>-l</option> flag. This sets the server address to
194 localhost (disabling the <command>server</command> so that the server
195 address cannot be overridden). Connections to the local server will
196 use a TSIG key found in <filename>/var/run/named/session.key</filename>,
197 which is automatically generated by <command>named</command> if any
198 local master zone has set <command>update-policy</command> to
199 <command>local</command>. The location of this key file can be
200 overridden with the <option>-k</option> option.
203 By default, <command>nsupdate</command>
204 uses UDP to send update requests to the name server unless they are too
205 large to fit in a UDP request in which case TCP will be used.
209 <command>nsupdate</command>
210 use a TCP connection.
211 This may be preferable when a batch of update requests is made.
214 The <option>-p</option> sets the default port number to use for
215 connections to a name server. The default is 53.
218 The <option>-t</option> option sets the maximum time an update request
220 take before it is aborted. The default is 300 seconds. Zero can be
222 to disable the timeout.
225 The <option>-u</option> option sets the UDP retry interval. The default
227 3 seconds. If zero, the interval will be computed from the timeout
229 and number of UDP retries.
232 The <option>-r</option> option sets the number of UDP retries. The
234 3. If zero, only one update request will be made.
237 The <option>-R <replaceable
238 class="parameter">randomdev</replaceable></option> option
239 specifies a source of randomness. If the operating system
240 does not provide a <filename>/dev/random</filename> or
241 equivalent device, the default source of randomness is keyboard
242 input. <filename>randomdev</filename> specifies the name of
243 a character device or file containing random data to be used
244 instead of the default. The special value
245 <filename>keyboard</filename> indicates that keyboard input
246 should be used. This option may be specified multiple times.
249 The -V option causes <command>nsupdate</command> to print the
250 version number and exit.
255 <title>INPUT FORMAT</title>
256 <para><command>nsupdate</command>
258 <parameter>filename</parameter>
260 Each command is supplied on exactly one line of input.
261 Some commands are for administrative purposes.
262 The others are either update instructions or prerequisite checks on the
263 contents of the zone.
264 These checks set conditions that some name or set of
265 resource records (RRset) either exists or is absent from the zone.
266 These conditions must be met if the entire update request is to succeed.
267 Updates will be rejected if the tests for the prerequisite conditions
271 Every update request consists of zero or more prerequisites
272 and zero or more updates.
273 This allows a suitably authenticated update request to proceed if some
274 specified resource records are present or missing from the zone.
275 A blank input line (or the <command>send</command> command)
277 accumulated commands to be sent as one Dynamic DNS update request to the
281 The command formats and their meaning are as follows:
286 <command>server</command>
287 <arg choice="req">servername</arg>
288 <arg choice="opt">port</arg>
292 Sends all dynamic update requests to the name server
293 <parameter>servername</parameter>.
294 When no server statement is provided,
295 <command>nsupdate</command>
296 will send updates to the master server of the correct zone.
297 The MNAME field of that zone's SOA record will identify the
299 server for that zone.
300 <parameter>port</parameter>
301 is the port number on
302 <parameter>servername</parameter>
303 where the dynamic update requests get sent.
304 If no port number is specified, the default DNS port number of
313 <command>local</command>
314 <arg choice="req">address</arg>
315 <arg choice="opt">port</arg>
319 Sends all dynamic update requests using the local
320 <parameter>address</parameter>.
322 When no local statement is provided,
323 <command>nsupdate</command>
324 will send updates using an address and port chosen by the
326 <parameter>port</parameter>
327 can additionally be used to make requests come from a specific
329 If no port number is specified, the system will assign one.
336 <command>zone</command>
337 <arg choice="req">zonename</arg>
341 Specifies that all updates are to be made to the zone
342 <parameter>zonename</parameter>.
344 <parameter>zone</parameter>
345 statement is provided,
346 <command>nsupdate</command>
347 will attempt determine the correct zone to update based on the
355 <command>class</command>
356 <arg choice="req">classname</arg>
360 Specify the default class.
361 If no <parameter>class</parameter> is specified, the
363 <parameter>IN</parameter>.
370 <command>ttl</command>
371 <arg choice="req">seconds</arg>
375 Specify the default time to live for records to be added.
376 The value <parameter>none</parameter> will clear the default
384 <command>key</command>
385 <arg choice="opt">hmac:</arg><arg choice="req">keyname</arg>
386 <arg choice="req">secret</arg>
390 Specifies that all updates are to be TSIG-signed using the
391 <parameter>keyname</parameter> <parameter>secret</parameter> pair.
392 If <parameter>hmac</parameter> is specified, then it sets the
393 signing algorithm in use; the default is
394 <literal>hmac-md5</literal>. The <command>key</command>
395 command overrides any key specified on the command line via
396 <option>-y</option> or <option>-k</option>.
403 <command>gsstsig</command>
407 Use GSS-TSIG to sign the updated. This is equivalent to
408 specifying <option>-g</option> on the commandline.
415 <command>oldgsstsig</command>
419 Use the Windows 2000 version of GSS-TSIG to sign the updated.
420 This is equivalent to specifying <option>-o</option> on the
428 <command>realm</command>
429 <arg choice="req"><optional>realm_name</optional></arg>
433 When using GSS-TSIG use <parameter>realm_name</parameter> rather
434 than the default realm in <filename>krb5.conf</filename>. If no
435 realm is specified the saved realm is cleared.
442 <command><optional>prereq</optional> nxdomain</command>
443 <arg choice="req">domain-name</arg>
447 Requires that no resource record of any type exists with name
448 <parameter>domain-name</parameter>.
456 <command><optional>prereq</optional> yxdomain</command>
457 <arg choice="req">domain-name</arg>
462 <parameter>domain-name</parameter>
463 exists (has as at least one resource record, of any type).
470 <command><optional>prereq</optional> nxrrset</command>
471 <arg choice="req">domain-name</arg>
472 <arg choice="opt">class</arg>
473 <arg choice="req">type</arg>
477 Requires that no resource record exists of the specified
478 <parameter>type</parameter>,
479 <parameter>class</parameter>
481 <parameter>domain-name</parameter>.
483 <parameter>class</parameter>
484 is omitted, IN (internet) is assumed.
492 <command><optional>prereq</optional> yxrrset</command>
493 <arg choice="req">domain-name</arg>
494 <arg choice="opt">class</arg>
495 <arg choice="req">type</arg>
499 This requires that a resource record of the specified
500 <parameter>type</parameter>,
501 <parameter>class</parameter>
503 <parameter>domain-name</parameter>
506 <parameter>class</parameter>
507 is omitted, IN (internet) is assumed.
514 <command><optional>prereq</optional> yxrrset</command>
515 <arg choice="req">domain-name</arg>
516 <arg choice="opt">class</arg>
517 <arg choice="req">type</arg>
518 <arg choice="req" rep="repeat">data</arg>
523 <parameter>data</parameter>
524 from each set of prerequisites of this form
526 <parameter>type</parameter>,
527 <parameter>class</parameter>,
529 <parameter>domain-name</parameter>
530 are combined to form a set of RRs. This set of RRs must
531 exactly match the set of RRs existing in the zone at the
533 <parameter>type</parameter>,
534 <parameter>class</parameter>,
536 <parameter>domain-name</parameter>.
538 <parameter>data</parameter>
539 are written in the standard text representation of the resource
548 <command><optional>update</optional> del<optional>ete</optional></command>
549 <arg choice="req">domain-name</arg>
550 <arg choice="opt">ttl</arg>
551 <arg choice="opt">class</arg>
552 <arg choice="opt">type <arg choice="opt" rep="repeat">data</arg></arg>
556 Deletes any resource records named
557 <parameter>domain-name</parameter>.
559 <parameter>type</parameter>
561 <parameter>data</parameter>
562 is provided, only matching resource records will be removed.
563 The internet class is assumed if
564 <parameter>class</parameter>
566 <parameter>ttl</parameter>
567 is ignored, and is only allowed for compatibility.
574 <command><optional>update</optional> add</command>
575 <arg choice="req">domain-name</arg>
576 <arg choice="req">ttl</arg>
577 <arg choice="opt">class</arg>
578 <arg choice="req">type</arg>
579 <arg choice="req" rep="repeat">data</arg>
583 Adds a new resource record with the specified
584 <parameter>ttl</parameter>,
585 <parameter>class</parameter>
587 <parameter>data</parameter>.
594 <command>show</command>
598 Displays the current message, containing all of the
600 updates specified since the last send.
607 <command>send</command>
611 Sends the current message. This is equivalent to entering a
619 <command>answer</command>
630 <command>debug</command>
641 <command>version</command>
645 Print version number.
652 <command>help</command>
656 Print a list of commands.
665 Lines beginning with a semicolon are comments and are ignored.
671 <title>EXAMPLES</title>
673 The examples below show how
674 <command>nsupdate</command>
675 could be used to insert and delete resource records from the
676 <type>example.com</type>
678 Notice that the input in each example contains a trailing blank line so
680 a group of commands are sent as one dynamic update request to the
681 master name server for
682 <type>example.com</type>.
686 > update delete oldhost.example.com A
687 > update add newhost.example.com 86400 A 172.16.1.1
693 <type>oldhost.example.com</type>
696 <type>newhost.example.com</type>
697 with IP address 172.16.1.1 is added.
698 The newly-added record has a 1 day TTL (86400 seconds).
701 > prereq nxdomain nickname.example.com
702 > update add nickname.example.com 86400 CNAME somehost.example.com
707 The prerequisite condition gets the name server to check that there
708 are no resource records of any type for
709 <type>nickname.example.com</type>.
711 If there are, the update request fails.
712 If this name does not exist, a CNAME for it is added.
713 This ensures that when the CNAME is added, it cannot conflict with the
714 long-standing rule in RFC 1034 that a name must not exist as any other
715 record type if it exists as a CNAME.
716 (The rule has been updated for DNSSEC in RFC 2535 to allow CNAMEs to have
717 RRSIG, DNSKEY and NSEC records.)
726 <term><constant>/etc/resolv.conf</constant></term>
729 used to identify default name server
735 <term><constant>/var/run/named/session.key</constant></term>
738 sets the default TSIG key for use in local-only mode
744 <term><constant>K{name}.+157.+{random}.key</constant></term>
747 base-64 encoding of HMAC-MD5 key created by
749 <refentrytitle>dnssec-keygen</refentrytitle><manvolnum>8</manvolnum>
756 <term><constant>K{name}.+157.+{random}.private</constant></term>
759 base-64 encoding of HMAC-MD5 key created by
761 <refentrytitle>dnssec-keygen</refentrytitle><manvolnum>8</manvolnum>
771 <title>SEE ALSO</title>
773 <citetitle>RFC 2136</citetitle>,
774 <citetitle>RFC 3007</citetitle>,
775 <citetitle>RFC 2104</citetitle>,
776 <citetitle>RFC 2845</citetitle>,
777 <citetitle>RFC 1034</citetitle>,
778 <citetitle>RFC 2535</citetitle>,
779 <citetitle>RFC 2931</citetitle>,
781 <refentrytitle>named</refentrytitle><manvolnum>8</manvolnum>
784 <refentrytitle>ddns-confgen</refentrytitle><manvolnum>8</manvolnum>
787 <refentrytitle>dnssec-keygen</refentrytitle><manvolnum>8</manvolnum>
795 The TSIG key is redundantly stored in two separate files.
796 This is a consequence of nsupdate using the DST library
797 for its cryptographic operations, and may change in future