2 - Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
3 - Copyright (C) 2000-2003 Internet Software Consortium.
5 - Permission to use, copy, modify, and/or distribute this software for any
6 - purpose with or without fee is hereby granted, provided that the above
7 - copyright notice and this permission notice appear in all copies.
9 - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10 - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11 - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12 - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13 - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14 - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15 - PERFORMANCE OF THIS SOFTWARE.
17 <!-- Id: nsupdate.html,v 1.48 2009/10/16 04:20:32 tbox Exp -->
20 <meta http-equiv=
"Content-Type" content=
"text/html; charset=ISO-8859-1">
21 <title>nsupdate
</title>
22 <meta name=
"generator" content=
"DocBook XSL Stylesheets V1.71.1">
24 <body bgcolor=
"white" text=
"black" link=
"#0000FF" vlink=
"#840084" alink=
"#0000FF"><div class=
"refentry" lang=
"en">
25 <a name=
"man.nsupdate"></a><div class=
"titlepage"></div>
26 <div class=
"refnamediv">
28 <p><span class=
"application">nsupdate
</span> — Dynamic DNS update utility
</p>
30 <div class=
"refsynopsisdiv">
32 <div class=
"cmdsynopsis"><p><code class=
"command">nsupdate
</code> [
<code class=
"option">-d
</code>] [
<code class=
"option">-D
</code>] [[
<code class=
"option">-g
</code>] | [
<code class=
"option">-o
</code>] | [
<code class=
"option">-l
</code>] | [
<code class=
"option">-y
<em class=
"replaceable"><code>[
<span class=
"optional">hmac:
</span>]keyname:secret
</code></em></code>] | [
<code class=
"option">-k
<em class=
"replaceable"><code>keyfile
</code></em></code>]] [
<code class=
"option">-t
<em class=
"replaceable"><code>timeout
</code></em></code>] [
<code class=
"option">-u
<em class=
"replaceable"><code>udptimeout
</code></em></code>] [
<code class=
"option">-r
<em class=
"replaceable"><code>udpretries
</code></em></code>] [
<code class=
"option">-R
<em class=
"replaceable"><code>randomdev
</code></em></code>] [
<code class=
"option">-v
</code>] [filename]
</p></div>
34 <div class=
"refsect1" lang=
"en">
35 <a name=
"id2543453"></a><h2>DESCRIPTION
</h2>
36 <p><span><strong class=
"command">nsupdate
</strong></span>
37 is used to submit Dynamic DNS Update requests as defined in RFC
2136
39 This allows resource records to be added or removed from a zone
40 without manually editing the zone file.
41 A single update request can contain requests to add or remove more than
46 Zones that are under dynamic control via
47 <span><strong class=
"command">nsupdate
</strong></span>
48 or a DHCP server should not be edited by hand.
50 conflict with dynamic updates and cause data to be lost.
53 The resource records that are dynamically added or removed with
54 <span><strong class=
"command">nsupdate
</strong></span>
55 have to be in the same zone.
56 Requests are sent to the zone's master server.
57 This is identified by the MNAME field of the zone's SOA record.
61 <code class=
"option">-d
</code>
63 <span><strong class=
"command">nsupdate
</strong></span>
64 operate in debug mode.
65 This provides tracing information about the update requests that are
66 made and the replies received from the name server.
69 The
<code class=
"option">-D
</code> option makes
<span><strong class=
"command">nsupdate
</strong></span>
70 report additional debugging information to
<code class=
"option">-d
</code>.
73 The
<code class=
"option">-L
</code> option with an integer argument of zero or
74 higher sets the logging debug level. If zero, logging is disabled.
77 Transaction signatures can be used to authenticate the Dynamic
78 DNS updates. These use the TSIG resource record type described
79 in RFC
2845 or the SIG(
0) record described in RFC
2535 and
80 RFC
2931 or GSS-TSIG as described in RFC
3645. TSIG relies on
81 a shared secret that should only be known to
82 <span><strong class=
"command">nsupdate
</strong></span> and the name server. Currently,
83 the only supported encryption algorithm for TSIG is HMAC-MD5,
84 which is defined in RFC
2104. Once other algorithms are
85 defined for TSIG, applications will need to ensure they select
86 the appropriate algorithm as well as the key when authenticating
87 each other. For instance, suitable
<span class=
"type">key
</span> and
88 <span class=
"type">server
</span> statements would be added to
89 <code class=
"filename">/etc/named.conf
</code> so that the name server
90 can associate the appropriate secret key and algorithm with
91 the IP address of the client application that will be using
92 TSIG authentication. SIG(
0) uses public key cryptography.
93 To use a SIG(
0) key, the public key must be stored in a KEY
94 record in a zone served by the name server.
95 <span><strong class=
"command">nsupdate
</strong></span> does not read
96 <code class=
"filename">/etc/named.conf
</code>.
99 GSS-TSIG uses Kerberos credentials. Standard GSS-TSIG mode
100 is switched on with the
<code class=
"option">-g
</code> flag. A
101 non-standards-compliant variant of GSS-TSIG used by Windows
102 2000 can be switched on with the
<code class=
"option">-o
</code> flag.
104 <p><span><strong class=
"command">nsupdate
</strong></span>
105 uses the
<code class=
"option">-y
</code> or
<code class=
"option">-k
</code> option
106 to provide the shared secret needed to generate a TSIG record
107 for authenticating Dynamic DNS update requests, default type
108 HMAC-MD5. These options are mutually exclusive.
111 When the
<code class=
"option">-y
</code> option is used, a signature is
113 [
<span class=
"optional"><em class=
"parameter"><code>hmac:
</code></em></span>]
<em class=
"parameter"><code>keyname:secret.
</code></em>
114 <em class=
"parameter"><code>keyname
</code></em> is the name of the key, and
115 <em class=
"parameter"><code>secret
</code></em> is the base64 encoded shared secret.
116 Use of the
<code class=
"option">-y
</code> option is discouraged because the
117 shared secret is supplied as a command line argument in clear text.
118 This may be visible in the output from
119 <span class=
"citerefentry"><span class=
"refentrytitle">ps
</span>(
1)
</span>
120 or in a history file maintained by the user's shell.
124 <code class=
"option">-k
</code> option,
<span><strong class=
"command">nsupdate
</strong></span> reads
125 the shared secret from the file
<em class=
"parameter"><code>keyfile
</code></em>.
126 Keyfiles may be in two formats: a single file containing
127 a
<code class=
"filename">named.conf
</code>-format
<span><strong class=
"command">key
</strong></span>
128 statement, which may be generated automatically by
129 <span><strong class=
"command">ddns-confgen
</strong></span>, or a pair of files whose names are
130 of the format
<code class=
"filename">K{name}.+
157.+{random}.key
</code> and
131 <code class=
"filename">K{name}.+
157.+{random}.private
</code>, which can be
132 generated by
<span><strong class=
"command">dnssec-keygen
</strong></span>.
133 The
<code class=
"option">-k
</code> may also be used to specify a SIG(
0) key used
134 to authenticate Dynamic DNS update requests. In this case, the key
135 specified is not an HMAC-MD5 key.
138 <span><strong class=
"command">nsupdate
</strong></span> can be run in a local-host only mode
139 using the
<code class=
"option">-l
</code> flag. This sets the server address to
140 localhost (disabling the
<span><strong class=
"command">server
</strong></span> so that the server
141 address cannot be overridden). Connections to the local server will
142 use a TSIG key found in
<code class=
"filename">/var/run/named/ddns.key
</code>,
143 which is automatically generated by
<span><strong class=
"command">named
</strong></span> if any
144 local master zone has set
<span><strong class=
"command">update-policy
</strong></span> to
145 <span><strong class=
"command">local
</strong></span>. The location of this key file can be
146 overridden with the
<code class=
"option">-k
</code> option.
149 By default,
<span><strong class=
"command">nsupdate
</strong></span>
150 uses UDP to send update requests to the name server unless they are too
151 large to fit in a UDP request in which case TCP will be used.
153 <code class=
"option">-v
</code>
155 <span><strong class=
"command">nsupdate
</strong></span>
156 use a TCP connection.
157 This may be preferable when a batch of update requests is made.
160 The
<code class=
"option">-p
</code> sets the default port number to use for
161 connections to a name server. The default is
53.
164 The
<code class=
"option">-t
</code> option sets the maximum time an update request
166 take before it is aborted. The default is
300 seconds. Zero can be
168 to disable the timeout.
171 The
<code class=
"option">-u
</code> option sets the UDP retry interval. The default
173 3 seconds. If zero, the interval will be computed from the timeout
175 and number of UDP retries.
178 The
<code class=
"option">-r
</code> option sets the number of UDP retries. The
180 3. If zero, only one update request will be made.
183 The
<code class=
"option">-R
<em class=
"replaceable"><code>randomdev
</code></em></code> option
184 specifies a source of randomness. If the operating system
185 does not provide a
<code class=
"filename">/dev/random
</code> or
186 equivalent device, the default source of randomness is keyboard
187 input.
<code class=
"filename">randomdev
</code> specifies the name of
188 a character device or file containing random data to be used
189 instead of the default. The special value
190 <code class=
"filename">keyboard
</code> indicates that keyboard input
191 should be used. This option may be specified multiple times.
194 <div class=
"refsect1" lang=
"en">
195 <a name=
"id2543785"></a><h2>INPUT FORMAT
</h2>
196 <p><span><strong class=
"command">nsupdate
</strong></span>
198 <em class=
"parameter"><code>filename
</code></em>
200 Each command is supplied on exactly one line of input.
201 Some commands are for administrative purposes.
202 The others are either update instructions or prerequisite checks on the
203 contents of the zone.
204 These checks set conditions that some name or set of
205 resource records (RRset) either exists or is absent from the zone.
206 These conditions must be met if the entire update request is to succeed.
207 Updates will be rejected if the tests for the prerequisite conditions
211 Every update request consists of zero or more prerequisites
212 and zero or more updates.
213 This allows a suitably authenticated update request to proceed if some
214 specified resource records are present or missing from the zone.
215 A blank input line (or the
<span><strong class=
"command">send
</strong></span> command)
217 accumulated commands to be sent as one Dynamic DNS update request to the
221 The command formats and their meaning are as follows:
223 <div class=
"variablelist"><dl>
224 <dt><span class=
"term">
225 <span><strong class=
"command">server
</strong></span>
230 Sends all dynamic update requests to the name server
231 <em class=
"parameter"><code>servername
</code></em>.
232 When no server statement is provided,
233 <span><strong class=
"command">nsupdate
</strong></span>
234 will send updates to the master server of the correct zone.
235 The MNAME field of that zone's SOA record will identify the
237 server for that zone.
238 <em class=
"parameter"><code>port
</code></em>
239 is the port number on
240 <em class=
"parameter"><code>servername
</code></em>
241 where the dynamic update requests get sent.
242 If no port number is specified, the default DNS port number of
246 <dt><span class=
"term">
247 <span><strong class=
"command">local
</strong></span>
252 Sends all dynamic update requests using the local
253 <em class=
"parameter"><code>address
</code></em>.
255 When no local statement is provided,
256 <span><strong class=
"command">nsupdate
</strong></span>
257 will send updates using an address and port chosen by the
259 <em class=
"parameter"><code>port
</code></em>
260 can additionally be used to make requests come from a specific
262 If no port number is specified, the system will assign one.
264 <dt><span class=
"term">
265 <span><strong class=
"command">zone
</strong></span>
269 Specifies that all updates are to be made to the zone
270 <em class=
"parameter"><code>zonename
</code></em>.
272 <em class=
"parameter"><code>zone
</code></em>
273 statement is provided,
274 <span><strong class=
"command">nsupdate
</strong></span>
275 will attempt determine the correct zone to update based on the
278 <dt><span class=
"term">
279 <span><strong class=
"command">class
</strong></span>
283 Specify the default class.
284 If no
<em class=
"parameter"><code>class
</code></em> is specified, the
286 <em class=
"parameter"><code>IN
</code></em>.
288 <dt><span class=
"term">
289 <span><strong class=
"command">ttl
</strong></span>
293 Specify the default time to live for records to be added.
294 The value
<em class=
"parameter"><code>none
</code></em> will clear the default
297 <dt><span class=
"term">
298 <span><strong class=
"command">key
</strong></span>
303 Specifies that all updates are to be TSIG-signed using the
304 <em class=
"parameter"><code>keyname
</code></em> <em class=
"parameter"><code>keysecret
</code></em> pair.
305 The
<span><strong class=
"command">key
</strong></span> command
306 overrides any key specified on the command line via
307 <code class=
"option">-y
</code> or
<code class=
"option">-k
</code>.
309 <dt><span class=
"term">
310 <span><strong class=
"command">prereq nxdomain
</strong></span>
314 Requires that no resource record of any type exists with name
315 <em class=
"parameter"><code>domain-name
</code></em>.
317 <dt><span class=
"term">
318 <span><strong class=
"command">prereq yxdomain
</strong></span>
323 <em class=
"parameter"><code>domain-name
</code></em>
324 exists (has as at least one resource record, of any type).
326 <dt><span class=
"term">
327 <span><strong class=
"command">prereq nxrrset
</strong></span>
333 Requires that no resource record exists of the specified
334 <em class=
"parameter"><code>type
</code></em>,
335 <em class=
"parameter"><code>class
</code></em>
337 <em class=
"parameter"><code>domain-name
</code></em>.
339 <em class=
"parameter"><code>class
</code></em>
340 is omitted, IN (internet) is assumed.
342 <dt><span class=
"term">
343 <span><strong class=
"command">prereq yxrrset
</strong></span>
349 This requires that a resource record of the specified
350 <em class=
"parameter"><code>type
</code></em>,
351 <em class=
"parameter"><code>class
</code></em>
353 <em class=
"parameter"><code>domain-name
</code></em>
356 <em class=
"parameter"><code>class
</code></em>
357 is omitted, IN (internet) is assumed.
359 <dt><span class=
"term">
360 <span><strong class=
"command">prereq yxrrset
</strong></span>
368 <em class=
"parameter"><code>data
</code></em>
369 from each set of prerequisites of this form
371 <em class=
"parameter"><code>type
</code></em>,
372 <em class=
"parameter"><code>class
</code></em>,
374 <em class=
"parameter"><code>domain-name
</code></em>
375 are combined to form a set of RRs. This set of RRs must
376 exactly match the set of RRs existing in the zone at the
378 <em class=
"parameter"><code>type
</code></em>,
379 <em class=
"parameter"><code>class
</code></em>,
381 <em class=
"parameter"><code>domain-name
</code></em>.
383 <em class=
"parameter"><code>data
</code></em>
384 are written in the standard text representation of the resource
388 <dt><span class=
"term">
389 <span><strong class=
"command">update delete
</strong></span>
396 Deletes any resource records named
397 <em class=
"parameter"><code>domain-name
</code></em>.
399 <em class=
"parameter"><code>type
</code></em>
401 <em class=
"parameter"><code>data
</code></em>
402 is provided, only matching resource records will be removed.
403 The internet class is assumed if
404 <em class=
"parameter"><code>class
</code></em>
406 <em class=
"parameter"><code>ttl
</code></em>
407 is ignored, and is only allowed for compatibility.
409 <dt><span class=
"term">
410 <span><strong class=
"command">update add
</strong></span>
418 Adds a new resource record with the specified
419 <em class=
"parameter"><code>ttl
</code></em>,
420 <em class=
"parameter"><code>class
</code></em>
422 <em class=
"parameter"><code>data
</code></em>.
424 <dt><span class=
"term">
425 <span><strong class=
"command">show
</strong></span>
428 Displays the current message, containing all of the
430 updates specified since the last send.
432 <dt><span class=
"term">
433 <span><strong class=
"command">send
</strong></span>
436 Sends the current message. This is equivalent to entering a
439 <dt><span class=
"term">
440 <span><strong class=
"command">answer
</strong></span>
445 <dt><span class=
"term">
446 <span><strong class=
"command">debug
</strong></span>
455 Lines beginning with a semicolon are comments and are ignored.
458 <div class=
"refsect1" lang=
"en">
459 <a name=
"id2544626"></a><h2>EXAMPLES
</h2>
461 The examples below show how
462 <span><strong class=
"command">nsupdate
</strong></span>
463 could be used to insert and delete resource records from the
464 <span class=
"type">example.com
</span>
466 Notice that the input in each example contains a trailing blank line so
468 a group of commands are sent as one dynamic update request to the
469 master name server for
470 <span class=
"type">example.com
</span>.
473 <pre class=
"programlisting">
475 > update delete oldhost.example.com A
476 > update add newhost.example.com
86400 A
172.16.1.1
483 <span class=
"type">oldhost.example.com
</span>
486 <span class=
"type">newhost.example.com
</span>
487 with IP address
172.16.1.1 is added.
488 The newly-added record has a
1 day TTL (
86400 seconds).
490 <pre class=
"programlisting">
492 > prereq nxdomain nickname.example.com
493 > update add nickname.example.com
86400 CNAME somehost.example.com
499 The prerequisite condition gets the name server to check that there
500 are no resource records of any type for
501 <span class=
"type">nickname.example.com
</span>.
503 If there are, the update request fails.
504 If this name does not exist, a CNAME for it is added.
505 This ensures that when the CNAME is added, it cannot conflict with the
506 long-standing rule in RFC
1034 that a name must not exist as any other
507 record type if it exists as a CNAME.
508 (The rule has been updated for DNSSEC in RFC
2535 to allow CNAMEs to have
509 RRSIG, DNSKEY and NSEC records.)
512 <div class=
"refsect1" lang=
"en">
513 <a name=
"id2544669"></a><h2>FILES
</h2>
514 <div class=
"variablelist"><dl>
515 <dt><span class=
"term"><code class=
"constant">/etc/resolv.conf
</code></span></dt>
517 used to identify default name server
519 <dt><span class=
"term"><code class=
"constant">/var/run/named/ddns.key
</code></span></dt>
521 sets the default TSIG key for use in local-only mode
523 <dt><span class=
"term"><code class=
"constant">K{name}.+
157.+{random}.key
</code></span></dt>
525 base-
64 encoding of HMAC-MD5 key created by
526 <span class=
"citerefentry"><span class=
"refentrytitle">dnssec-keygen
</span>(
8)
</span>.
528 <dt><span class=
"term"><code class=
"constant">K{name}.+
157.+{random}.private
</code></span></dt>
530 base-
64 encoding of HMAC-MD5 key created by
531 <span class=
"citerefentry"><span class=
"refentrytitle">dnssec-keygen
</span>(
8)
</span>.
535 <div class=
"refsect1" lang=
"en">
536 <a name=
"id2544753"></a><h2>SEE ALSO
</h2>
538 <em class=
"citetitle">RFC
2136</em>,
539 <em class=
"citetitle">RFC
3007</em>,
540 <em class=
"citetitle">RFC
2104</em>,
541 <em class=
"citetitle">RFC
2845</em>,
542 <em class=
"citetitle">RFC
1034</em>,
543 <em class=
"citetitle">RFC
2535</em>,
544 <em class=
"citetitle">RFC
2931</em>,
545 <span class=
"citerefentry"><span class=
"refentrytitle">named
</span>(
8)
</span>,
546 <span class=
"citerefentry"><span class=
"refentrytitle">ddns-confgen
</span>(
8)
</span>,
547 <span class=
"citerefentry"><span class=
"refentrytitle">dnssec-keygen
</span>(
8)
</span>.
550 <div class=
"refsect1" lang=
"en">
551 <a name=
"id2542148"></a><h2>BUGS
</h2>
553 The TSIG key is redundantly stored in two separate files.
554 This is a consequence of nsupdate using the DST library
555 for its cryptographic operations, and may change in future