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>-T</option></arg>
76 <arg><option>-P</option></arg>
77 <arg><option>-V</option></arg>
83 <title>DESCRIPTION</title>
84 <para><command>nsupdate</command>
85 is used to submit Dynamic DNS Update requests as defined in RFC 2136
87 This allows resource records to be added or removed from a zone
88 without manually editing the zone file.
89 A single update request can contain requests to add or remove more than
94 Zones that are under dynamic control via
95 <command>nsupdate</command>
96 or a DHCP server should not be edited by hand.
98 conflict with dynamic updates and cause data to be lost.
101 The resource records that are dynamically added or removed with
102 <command>nsupdate</command>
103 have to be in the same zone.
104 Requests are sent to the zone's master server.
105 This is identified by the MNAME field of the zone's SOA record.
111 <command>nsupdate</command>
112 operate in debug mode.
113 This provides tracing information about the update requests that are
114 made and the replies received from the name server.
117 The <option>-D</option> option makes <command>nsupdate</command>
118 report additional debugging information to <option>-d</option>.
121 The <option>-L</option> option with an integer argument of zero or
122 higher sets the logging debug level. If zero, logging is disabled.
125 Transaction signatures can be used to authenticate the Dynamic
126 DNS updates. These use the TSIG resource record type described
127 in RFC 2845 or the SIG(0) record described in RFC 2535 and
128 RFC 2931 or GSS-TSIG as described in RFC 3645. TSIG relies on
129 a shared secret that should only be known to
130 <command>nsupdate</command> and the name server. Currently,
131 the only supported encryption algorithm for TSIG is HMAC-MD5,
132 which is defined in RFC 2104. Once other algorithms are
133 defined for TSIG, applications will need to ensure they select
134 the appropriate algorithm as well as the key when authenticating
135 each other. For instance, suitable <type>key</type> and
136 <type>server</type> statements would be added to
137 <filename>/etc/named.conf</filename> so that the name server
138 can associate the appropriate secret key and algorithm with
139 the IP address of the client application that will be using
140 TSIG authentication. SIG(0) uses public key cryptography.
141 To use a SIG(0) key, the public key must be stored in a KEY
142 record in a zone served by the name server.
143 <command>nsupdate</command> does not read
144 <filename>/etc/named.conf</filename>.
147 GSS-TSIG uses Kerberos credentials. Standard GSS-TSIG mode
148 is switched on with the <option>-g</option> flag. A
149 non-standards-compliant variant of GSS-TSIG used by Windows
150 2000 can be switched on with the <option>-o</option> flag.
152 <para><command>nsupdate</command>
153 uses the <option>-y</option> or <option>-k</option> option
154 to provide the shared secret needed to generate a TSIG record
155 for authenticating Dynamic DNS update requests, default type
156 HMAC-MD5. These options are mutually exclusive.
159 When the <option>-y</option> option is used, a signature is
161 <optional><parameter>hmac:</parameter></optional><parameter>keyname:secret.</parameter>
162 <parameter>keyname</parameter> is the name of the key, and
163 <parameter>secret</parameter> is the base64 encoded shared secret.
164 <parameter>hmac</parameter> is the name of the key algorithm;
165 valid choices are <literal>hmac-md5</literal>,
166 <literal>hmac-sha1</literal>, <literal>hmac-sha224</literal>,
167 <literal>hmac-sha256</literal>, <literal>hmac-sha384</literal>, or
168 <literal>hmac-sha512</literal>. If <parameter>hmac</parameter>
169 is not specified, the default is <literal>hmac-md5</literal>.
170 NOTE: Use of the <option>-y</option> option is discouraged because the
171 shared secret is supplied as a command line argument in clear text.
172 This may be visible in the output from
174 <refentrytitle>ps</refentrytitle><manvolnum>1</manvolnum>
176 or in a history file maintained by the user's shell.
180 <option>-k</option> option, <command>nsupdate</command> reads
181 the shared secret from the file <parameter>keyfile</parameter>.
182 Keyfiles may be in two formats: a single file containing
183 a <filename>named.conf</filename>-format <command>key</command>
184 statement, which may be generated automatically by
185 <command>ddns-confgen</command>, or a pair of files whose names are
186 of the format <filename>K{name}.+157.+{random}.key</filename> and
187 <filename>K{name}.+157.+{random}.private</filename>, which can be
188 generated by <command>dnssec-keygen</command>.
189 The <option>-k</option> may also be used to specify a SIG(0) key used
190 to authenticate Dynamic DNS update requests. In this case, the key
191 specified is not an HMAC-MD5 key.
194 <command>nsupdate</command> can be run in a local-host only mode
195 using the <option>-l</option> flag. This sets the server address to
196 localhost (disabling the <command>server</command> so that the server
197 address cannot be overridden). Connections to the local server will
198 use a TSIG key found in <filename>/var/run/named/session.key</filename>,
199 which is automatically generated by <command>named</command> if any
200 local master zone has set <command>update-policy</command> to
201 <command>local</command>. The location of this key file can be
202 overridden with the <option>-k</option> option.
205 By default, <command>nsupdate</command>
206 uses UDP to send update requests to the name server unless they are too
207 large to fit in a UDP request in which case TCP will be used.
211 <command>nsupdate</command>
212 use a TCP connection.
213 This may be preferable when a batch of update requests is made.
216 The <option>-p</option> sets the default port number to use for
217 connections to a name server. The default is 53.
220 The <option>-t</option> option sets the maximum time an update request
222 take before it is aborted. The default is 300 seconds. Zero can be
224 to disable the timeout.
227 The <option>-u</option> option sets the UDP retry interval. The default
229 3 seconds. If zero, the interval will be computed from the timeout
231 and number of UDP retries.
234 The <option>-r</option> option sets the number of UDP retries. The
236 3. If zero, only one update request will be made.
239 The <option>-R <replaceable
240 class="parameter">randomdev</replaceable></option> option
241 specifies a source of randomness. If the operating system
242 does not provide a <filename>/dev/random</filename> or
243 equivalent device, the default source of randomness is keyboard
244 input. <filename>randomdev</filename> specifies the name of
245 a character device or file containing random data to be used
246 instead of the default. The special value
247 <filename>keyboard</filename> indicates that keyboard input
248 should be used. This option may be specified multiple times.
251 Other types can be entered using "TYPEXXXXX" where "XXXXX" is the
252 decimal value of the type with no leading zeros. The rdata,
253 if present, will be parsed using the UNKNOWN rdata format,
254 (<backslash> <hash> <space> <length>
255 <space> <hexstring>).
258 The <option>-T</option> and <option>-P</option> options print out
259 lists of non-meta types for which the type-specific presentation
260 formats are known. <option>-T</option> prints out the list of
261 IANA-assigned types. <option>-P</option> prints out the list of
262 private types specific to <command>named</command>. These options
263 may be combined. <command>nsupdate</command> will exit after the
267 The -V option causes <command>nsupdate</command> to print the
268 version number and exit.
273 <title>INPUT FORMAT</title>
274 <para><command>nsupdate</command>
276 <parameter>filename</parameter>
278 Each command is supplied on exactly one line of input.
279 Some commands are for administrative purposes.
280 The others are either update instructions or prerequisite checks on the
281 contents of the zone.
282 These checks set conditions that some name or set of
283 resource records (RRset) either exists or is absent from the zone.
284 These conditions must be met if the entire update request is to succeed.
285 Updates will be rejected if the tests for the prerequisite conditions
289 Every update request consists of zero or more prerequisites
290 and zero or more updates.
291 This allows a suitably authenticated update request to proceed if some
292 specified resource records are present or missing from the zone.
293 A blank input line (or the <command>send</command> command)
295 accumulated commands to be sent as one Dynamic DNS update request to the
299 The command formats and their meaning are as follows:
304 <command>server</command>
305 <arg choice="req">servername</arg>
306 <arg choice="opt">port</arg>
310 Sends all dynamic update requests to the name server
311 <parameter>servername</parameter>.
312 When no server statement is provided,
313 <command>nsupdate</command>
314 will send updates to the master server of the correct zone.
315 The MNAME field of that zone's SOA record will identify the
317 server for that zone.
318 <parameter>port</parameter>
319 is the port number on
320 <parameter>servername</parameter>
321 where the dynamic update requests get sent.
322 If no port number is specified, the default DNS port number of
331 <command>local</command>
332 <arg choice="req">address</arg>
333 <arg choice="opt">port</arg>
337 Sends all dynamic update requests using the local
338 <parameter>address</parameter>.
340 When no local statement is provided,
341 <command>nsupdate</command>
342 will send updates using an address and port chosen by the
344 <parameter>port</parameter>
345 can additionally be used to make requests come from a specific
347 If no port number is specified, the system will assign one.
354 <command>zone</command>
355 <arg choice="req">zonename</arg>
359 Specifies that all updates are to be made to the zone
360 <parameter>zonename</parameter>.
362 <parameter>zone</parameter>
363 statement is provided,
364 <command>nsupdate</command>
365 will attempt determine the correct zone to update based on the
373 <command>class</command>
374 <arg choice="req">classname</arg>
378 Specify the default class.
379 If no <parameter>class</parameter> is specified, the
381 <parameter>IN</parameter>.
388 <command>ttl</command>
389 <arg choice="req">seconds</arg>
393 Specify the default time to live for records to be added.
394 The value <parameter>none</parameter> will clear the default
402 <command>key</command>
403 <arg choice="opt">hmac:</arg><arg choice="req">keyname</arg>
404 <arg choice="req">secret</arg>
408 Specifies that all updates are to be TSIG-signed using the
409 <parameter>keyname</parameter> <parameter>secret</parameter> pair.
410 If <parameter>hmac</parameter> is specified, then it sets the
411 signing algorithm in use; the default is
412 <literal>hmac-md5</literal>. The <command>key</command>
413 command overrides any key specified on the command line via
414 <option>-y</option> or <option>-k</option>.
421 <command>gsstsig</command>
425 Use GSS-TSIG to sign the updated. This is equivalent to
426 specifying <option>-g</option> on the commandline.
433 <command>oldgsstsig</command>
437 Use the Windows 2000 version of GSS-TSIG to sign the updated.
438 This is equivalent to specifying <option>-o</option> on the
446 <command>realm</command>
447 <arg choice="req"><optional>realm_name</optional></arg>
451 When using GSS-TSIG use <parameter>realm_name</parameter> rather
452 than the default realm in <filename>krb5.conf</filename>. If no
453 realm is specified the saved realm is cleared.
460 <command><optional>prereq</optional> nxdomain</command>
461 <arg choice="req">domain-name</arg>
465 Requires that no resource record of any type exists with name
466 <parameter>domain-name</parameter>.
474 <command><optional>prereq</optional> yxdomain</command>
475 <arg choice="req">domain-name</arg>
480 <parameter>domain-name</parameter>
481 exists (has as at least one resource record, of any type).
488 <command><optional>prereq</optional> nxrrset</command>
489 <arg choice="req">domain-name</arg>
490 <arg choice="opt">class</arg>
491 <arg choice="req">type</arg>
495 Requires that no resource record exists of the specified
496 <parameter>type</parameter>,
497 <parameter>class</parameter>
499 <parameter>domain-name</parameter>.
501 <parameter>class</parameter>
502 is omitted, IN (internet) is assumed.
510 <command><optional>prereq</optional> yxrrset</command>
511 <arg choice="req">domain-name</arg>
512 <arg choice="opt">class</arg>
513 <arg choice="req">type</arg>
517 This requires that a resource record of the specified
518 <parameter>type</parameter>,
519 <parameter>class</parameter>
521 <parameter>domain-name</parameter>
524 <parameter>class</parameter>
525 is omitted, IN (internet) is assumed.
532 <command><optional>prereq</optional> yxrrset</command>
533 <arg choice="req">domain-name</arg>
534 <arg choice="opt">class</arg>
535 <arg choice="req">type</arg>
536 <arg choice="req" rep="repeat">data</arg>
541 <parameter>data</parameter>
542 from each set of prerequisites of this form
544 <parameter>type</parameter>,
545 <parameter>class</parameter>,
547 <parameter>domain-name</parameter>
548 are combined to form a set of RRs. This set of RRs must
549 exactly match the set of RRs existing in the zone at the
551 <parameter>type</parameter>,
552 <parameter>class</parameter>,
554 <parameter>domain-name</parameter>.
556 <parameter>data</parameter>
557 are written in the standard text representation of the resource
566 <command><optional>update</optional> del<optional>ete</optional></command>
567 <arg choice="req">domain-name</arg>
568 <arg choice="opt">ttl</arg>
569 <arg choice="opt">class</arg>
570 <arg choice="opt">type <arg choice="opt" rep="repeat">data</arg></arg>
574 Deletes any resource records named
575 <parameter>domain-name</parameter>.
577 <parameter>type</parameter>
579 <parameter>data</parameter>
580 is provided, only matching resource records will be removed.
581 The internet class is assumed if
582 <parameter>class</parameter>
584 <parameter>ttl</parameter>
585 is ignored, and is only allowed for compatibility.
592 <command><optional>update</optional> add</command>
593 <arg choice="req">domain-name</arg>
594 <arg choice="req">ttl</arg>
595 <arg choice="opt">class</arg>
596 <arg choice="req">type</arg>
597 <arg choice="req" rep="repeat">data</arg>
601 Adds a new resource record with the specified
602 <parameter>ttl</parameter>,
603 <parameter>class</parameter>
605 <parameter>data</parameter>.
612 <command>show</command>
616 Displays the current message, containing all of the
618 updates specified since the last send.
625 <command>send</command>
629 Sends the current message. This is equivalent to entering a
637 <command>answer</command>
648 <command>debug</command>
659 <command>version</command>
663 Print version number.
670 <command>help</command>
674 Print a list of commands.
683 Lines beginning with a semicolon are comments and are ignored.
689 <title>EXAMPLES</title>
691 The examples below show how
692 <command>nsupdate</command>
693 could be used to insert and delete resource records from the
694 <type>example.com</type>
696 Notice that the input in each example contains a trailing blank line so
698 a group of commands are sent as one dynamic update request to the
699 master name server for
700 <type>example.com</type>.
704 > update delete oldhost.example.com A
705 > update add newhost.example.com 86400 A 172.16.1.1
711 <type>oldhost.example.com</type>
714 <type>newhost.example.com</type>
715 with IP address 172.16.1.1 is added.
716 The newly-added record has a 1 day TTL (86400 seconds).
719 > prereq nxdomain nickname.example.com
720 > update add nickname.example.com 86400 CNAME somehost.example.com
725 The prerequisite condition gets the name server to check that there
726 are no resource records of any type for
727 <type>nickname.example.com</type>.
729 If there are, the update request fails.
730 If this name does not exist, a CNAME for it is added.
731 This ensures that when the CNAME is added, it cannot conflict with the
732 long-standing rule in RFC 1034 that a name must not exist as any other
733 record type if it exists as a CNAME.
734 (The rule has been updated for DNSSEC in RFC 2535 to allow CNAMEs to have
735 RRSIG, DNSKEY and NSEC records.)
744 <term><constant>/etc/resolv.conf</constant></term>
747 used to identify default name server
753 <term><constant>/var/run/named/session.key</constant></term>
756 sets the default TSIG key for use in local-only mode
762 <term><constant>K{name}.+157.+{random}.key</constant></term>
765 base-64 encoding of HMAC-MD5 key created by
767 <refentrytitle>dnssec-keygen</refentrytitle><manvolnum>8</manvolnum>
774 <term><constant>K{name}.+157.+{random}.private</constant></term>
777 base-64 encoding of HMAC-MD5 key created by
779 <refentrytitle>dnssec-keygen</refentrytitle><manvolnum>8</manvolnum>
789 <title>SEE ALSO</title>
791 <citetitle>RFC 2136</citetitle>,
792 <citetitle>RFC 3007</citetitle>,
793 <citetitle>RFC 2104</citetitle>,
794 <citetitle>RFC 2845</citetitle>,
795 <citetitle>RFC 1034</citetitle>,
796 <citetitle>RFC 2535</citetitle>,
797 <citetitle>RFC 2931</citetitle>,
799 <refentrytitle>named</refentrytitle><manvolnum>8</manvolnum>
802 <refentrytitle>ddns-confgen</refentrytitle><manvolnum>8</manvolnum>
805 <refentrytitle>dnssec-keygen</refentrytitle><manvolnum>8</manvolnum>
813 The TSIG key is redundantly stored in two separate files.
814 This is a consequence of nsupdate using the DST library
815 for its cryptographic operations, and may change in future