ignore some files
[tridge/bind9.git] / bin / nsupdate / nsupdate.html
1 <!--
2  - Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
3  - Copyright (C) 2000-2003 Internet Software Consortium.
4  - 
5  - Permission to use, copy, modify, and 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.
8  - 
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.
16 -->
17 <!-- $Id: nsupdate.html,v 1.40.48.2 2009/03/10 01:54:11 tbox Exp $ -->
18 <html>
19 <head>
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">
23 </head>
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">
27 <h2>Name</h2>
28 <p><span class="application">nsupdate</span> &#8212; Dynamic DNS update utility</p>
29 </div>
30 <div class="refsynopsisdiv">
31 <h2>Synopsis</h2>
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">-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>
33 </div>
34 <div class="refsect1" lang="en">
35 <a name="id2543449"></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 RFC2136
38       to a name server.
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
42       one
43       resource record.
44     </p>
45 <p>
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.
49       Manual edits could
50       conflict with dynamic updates and cause data to be lost.
51     </p>
52 <p>
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.
58     </p>
59 <p>
60       The
61       <code class="option">-d</code>
62       option makes
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.
67     </p>
68 <p>
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>.
71     </p>
72 <p>
73       Transaction signatures can be used to authenticate the Dynamic
74       DNS updates.  These use the TSIG resource record type described
75       in RFC2845 or the SIG(0) record described in RFC3535 and
76       RFC2931 or GSS-TSIG as described in RFC3645.  TSIG relies on
77       a shared secret that should only be known to
78       <span><strong class="command">nsupdate</strong></span> and the name server.  Currently,
79       the only supported encryption algorithm for TSIG is HMAC-MD5,
80       which is defined in RFC 2104.  Once other algorithms are
81       defined for TSIG, applications will need to ensure they select
82       the appropriate algorithm as well as the key when authenticating
83       each other.  For instance, suitable <span class="type">key</span> and
84       <span class="type">server</span> statements would be added to
85       <code class="filename">/etc/named.conf</code> so that the name server
86       can associate the appropriate secret key and algorithm with
87       the IP address of the client application that will be using
88       TSIG authentication.  SIG(0) uses public key cryptography.
89       To use a SIG(0) key, the public key must be stored in a KEY
90       record in a zone served by the name server.
91       <span><strong class="command">nsupdate</strong></span> does not read
92       <code class="filename">/etc/named.conf</code>.
93       GSS-TSIG uses Kerberos credentials.
94     </p>
95 <p><span><strong class="command">nsupdate</strong></span>
96       uses the <code class="option">-y</code> or <code class="option">-k</code> option
97       to provide the shared secret needed to generate a TSIG record
98       for authenticating Dynamic DNS update requests, default type
99       HMAC-MD5.  These options are mutually exclusive.  With the
100       <code class="option">-k</code> option, <span><strong class="command">nsupdate</strong></span> reads
101       the shared secret from the file <em class="parameter"><code>keyfile</code></em>,
102       whose name is of the form
103       <code class="filename">K{name}.+157.+{random}.private</code>.  For
104       historical reasons, the file
105       <code class="filename">K{name}.+157.+{random}.key</code> must also be
106       present.  When the <code class="option">-y</code> option is used, a
107       signature is generated from
108       [<span class="optional"><em class="parameter"><code>hmac:</code></em></span>]<em class="parameter"><code>keyname:secret.</code></em>
109       <em class="parameter"><code>keyname</code></em> is the name of the key, and
110       <em class="parameter"><code>secret</code></em> is the base64 encoded shared
111       secret.  Use of the <code class="option">-y</code> option is discouraged
112       because the shared secret is supplied as a command line
113       argument in clear text.  This may be visible in the output
114       from
115       <span class="citerefentry"><span class="refentrytitle">ps</span>(1)</span> or in a history file maintained by the user's
116       shell.
117     </p>
118 <p>
119       The <code class="option">-k</code> may also be used to specify a SIG(0) key used
120       to authenticate Dynamic DNS update requests.  In this case, the key
121       specified is not an HMAC-MD5 key.
122     </p>
123 <p>
124       The <code class="option">-g</code> and <code class="option">-o</code> specify that
125       GSS-TSIG is to be used.  The <code class="option">-o</code> should only
126       be used with old Microsoft Windows 2000 servers.
127     </p>
128 <p>
129       By default,
130       <span><strong class="command">nsupdate</strong></span>
131       uses UDP to send update requests to the name server unless they are too
132       large to fit in a UDP request in which case TCP will be used.
133       The
134       <code class="option">-v</code>
135       option makes
136       <span><strong class="command">nsupdate</strong></span>
137       use a TCP connection.
138       This may be preferable when a batch of update requests is made.
139     </p>
140 <p>
141       The <code class="option">-t</code> option sets the maximum time an update request
142       can
143       take before it is aborted.  The default is 300 seconds.  Zero can be
144       used
145       to disable the timeout.
146     </p>
147 <p>
148       The <code class="option">-u</code> option sets the UDP retry interval.  The default
149       is
150       3 seconds.  If zero, the interval will be computed from the timeout
151       interval
152       and number of UDP retries.
153     </p>
154 <p>
155       The <code class="option">-r</code> option sets the number of UDP retries. The
156       default is
157       3.  If zero, only one update request will be made.
158     </p>
159 <p>
160       The <code class="option">-R <em class="replaceable"><code>randomdev</code></em></code> option
161       specifies a source of randomness.  If the operating system
162       does not provide a <code class="filename">/dev/random</code> or
163       equivalent device, the default source of randomness is keyboard
164       input.  <code class="filename">randomdev</code> specifies the name of
165       a character device or file containing random data to be used
166       instead of the default.  The special value
167       <code class="filename">keyboard</code> indicates that keyboard input
168       should be used.  This option may be specified multiple times.
169     </p>
170 </div>
171 <div class="refsect1" lang="en">
172 <a name="id2543726"></a><h2>INPUT FORMAT</h2>
173 <p><span><strong class="command">nsupdate</strong></span>
174       reads input from
175       <em class="parameter"><code>filename</code></em>
176       or standard input.
177       Each command is supplied on exactly one line of input.
178       Some commands are for administrative purposes.
179       The others are either update instructions or prerequisite checks on the
180       contents of the zone.
181       These checks set conditions that some name or set of
182       resource records (RRset) either exists or is absent from the zone.
183       These conditions must be met if the entire update request is to succeed.
184       Updates will be rejected if the tests for the prerequisite conditions
185       fail.
186     </p>
187 <p>
188       Every update request consists of zero or more prerequisites
189       and zero or more updates.
190       This allows a suitably authenticated update request to proceed if some
191       specified resource records are present or missing from the zone.
192       A blank input line (or the <span><strong class="command">send</strong></span> command)
193       causes the
194       accumulated commands to be sent as one Dynamic DNS update request to the
195       name server.
196     </p>
197 <p>
198       The command formats and their meaning are as follows:
199       </p>
200 <div class="variablelist"><dl>
201 <dt><span class="term">
202               <span><strong class="command">server</strong></span>
203                {servername}
204                [port]
205             </span></dt>
206 <dd><p>
207               Sends all dynamic update requests to the name server
208               <em class="parameter"><code>servername</code></em>.
209               When no server statement is provided,
210               <span><strong class="command">nsupdate</strong></span>
211               will send updates to the master server of the correct zone.
212               The MNAME field of that zone's SOA record will identify the
213               master
214               server for that zone.
215               <em class="parameter"><code>port</code></em>
216               is the port number on
217               <em class="parameter"><code>servername</code></em>
218               where the dynamic update requests get sent.
219               If no port number is specified, the default DNS port number of
220               53 is
221               used.
222             </p></dd>
223 <dt><span class="term">
224               <span><strong class="command">local</strong></span>
225                {address}
226                [port]
227             </span></dt>
228 <dd><p>
229               Sends all dynamic update requests using the local
230               <em class="parameter"><code>address</code></em>.
231
232               When no local statement is provided,
233               <span><strong class="command">nsupdate</strong></span>
234               will send updates using an address and port chosen by the
235               system.
236               <em class="parameter"><code>port</code></em>
237               can additionally be used to make requests come from a specific
238               port.
239               If no port number is specified, the system will assign one.
240             </p></dd>
241 <dt><span class="term">
242               <span><strong class="command">zone</strong></span>
243                {zonename}
244             </span></dt>
245 <dd><p>
246               Specifies that all updates are to be made to the zone
247               <em class="parameter"><code>zonename</code></em>.
248               If no
249               <em class="parameter"><code>zone</code></em>
250               statement is provided,
251               <span><strong class="command">nsupdate</strong></span>
252               will attempt determine the correct zone to update based on the
253               rest of the input.
254             </p></dd>
255 <dt><span class="term">
256               <span><strong class="command">class</strong></span>
257                {classname}
258             </span></dt>
259 <dd><p>
260               Specify the default class.
261               If no <em class="parameter"><code>class</code></em> is specified, the
262               default class is
263               <em class="parameter"><code>IN</code></em>.
264             </p></dd>
265 <dt><span class="term">
266               <span><strong class="command">ttl</strong></span>
267                {seconds}
268             </span></dt>
269 <dd><p>
270               Specify the default time to live for records to be added.
271               The value <em class="parameter"><code>none</code></em> will clear the default
272               ttl.
273             </p></dd>
274 <dt><span class="term">
275               <span><strong class="command">key</strong></span>
276                {name}
277                {secret}
278             </span></dt>
279 <dd><p>
280               Specifies that all updates are to be TSIG-signed using the
281               <em class="parameter"><code>keyname</code></em> <em class="parameter"><code>keysecret</code></em> pair.
282               The <span><strong class="command">key</strong></span> command
283               overrides any key specified on the command line via
284               <code class="option">-y</code> or <code class="option">-k</code>.
285             </p></dd>
286 <dt><span class="term">
287               <span><strong class="command">prereq nxdomain</strong></span>
288                {domain-name}
289             </span></dt>
290 <dd><p>
291               Requires that no resource record of any type exists with name
292               <em class="parameter"><code>domain-name</code></em>.
293             </p></dd>
294 <dt><span class="term">
295               <span><strong class="command">prereq yxdomain</strong></span>
296                {domain-name}
297             </span></dt>
298 <dd><p>
299               Requires that
300               <em class="parameter"><code>domain-name</code></em>
301               exists (has as at least one resource record, of any type).
302             </p></dd>
303 <dt><span class="term">
304               <span><strong class="command">prereq nxrrset</strong></span>
305                {domain-name}
306                [class]
307                {type}
308             </span></dt>
309 <dd><p>
310               Requires that no resource record exists of the specified
311               <em class="parameter"><code>type</code></em>,
312               <em class="parameter"><code>class</code></em>
313               and
314               <em class="parameter"><code>domain-name</code></em>.
315               If
316               <em class="parameter"><code>class</code></em>
317               is omitted, IN (internet) is assumed.
318             </p></dd>
319 <dt><span class="term">
320               <span><strong class="command">prereq yxrrset</strong></span>
321                {domain-name}
322                [class]
323                {type}
324             </span></dt>
325 <dd><p>
326               This requires that a resource record of the specified
327               <em class="parameter"><code>type</code></em>,
328               <em class="parameter"><code>class</code></em>
329               and
330               <em class="parameter"><code>domain-name</code></em>
331               must exist.
332               If
333               <em class="parameter"><code>class</code></em>
334               is omitted, IN (internet) is assumed.
335             </p></dd>
336 <dt><span class="term">
337               <span><strong class="command">prereq yxrrset</strong></span>
338                {domain-name}
339                [class]
340                {type}
341                {data...}
342             </span></dt>
343 <dd><p>
344               The
345               <em class="parameter"><code>data</code></em>
346               from each set of prerequisites of this form
347               sharing a common
348               <em class="parameter"><code>type</code></em>,
349               <em class="parameter"><code>class</code></em>,
350               and
351               <em class="parameter"><code>domain-name</code></em>
352               are combined to form a set of RRs.  This set of RRs must
353               exactly match the set of RRs existing in the zone at the
354               given
355               <em class="parameter"><code>type</code></em>,
356               <em class="parameter"><code>class</code></em>,
357               and
358               <em class="parameter"><code>domain-name</code></em>.
359               The
360               <em class="parameter"><code>data</code></em>
361               are written in the standard text representation of the resource
362               record's
363               RDATA.
364             </p></dd>
365 <dt><span class="term">
366               <span><strong class="command">update delete</strong></span>
367                {domain-name}
368                [ttl]
369                [class]
370                [type [data...]]
371             </span></dt>
372 <dd><p>
373               Deletes any resource records named
374               <em class="parameter"><code>domain-name</code></em>.
375               If
376               <em class="parameter"><code>type</code></em>
377               and
378               <em class="parameter"><code>data</code></em>
379               is provided, only matching resource records will be removed.
380               The internet class is assumed if
381               <em class="parameter"><code>class</code></em>
382               is not supplied.  The
383               <em class="parameter"><code>ttl</code></em>
384               is ignored, and is only allowed for compatibility.
385             </p></dd>
386 <dt><span class="term">
387               <span><strong class="command">update add</strong></span>
388                {domain-name}
389                {ttl}
390                [class]
391                {type}
392                {data...}
393             </span></dt>
394 <dd><p>
395               Adds a new resource record with the specified
396               <em class="parameter"><code>ttl</code></em>,
397               <em class="parameter"><code>class</code></em>
398               and
399               <em class="parameter"><code>data</code></em>.
400             </p></dd>
401 <dt><span class="term">
402               <span><strong class="command">show</strong></span>
403             </span></dt>
404 <dd><p>
405               Displays the current message, containing all of the
406               prerequisites and
407               updates specified since the last send.
408             </p></dd>
409 <dt><span class="term">
410               <span><strong class="command">send</strong></span>
411             </span></dt>
412 <dd><p>
413               Sends the current message.  This is equivalent to entering a
414               blank line.
415             </p></dd>
416 <dt><span class="term">
417               <span><strong class="command">answer</strong></span>
418             </span></dt>
419 <dd><p>
420               Displays the answer.
421             </p></dd>
422 <dt><span class="term">
423               <span><strong class="command">debug</strong></span>
424             </span></dt>
425 <dd><p>
426               Turn on debugging.
427             </p></dd>
428 </dl></div>
429 <p>
430     </p>
431 <p>
432       Lines beginning with a semicolon are comments and are ignored.
433     </p>
434 </div>
435 <div class="refsect1" lang="en">
436 <a name="id2544567"></a><h2>EXAMPLES</h2>
437 <p>
438       The examples below show how
439       <span><strong class="command">nsupdate</strong></span>
440       could be used to insert and delete resource records from the
441       <span class="type">example.com</span>
442       zone.
443       Notice that the input in each example contains a trailing blank line so
444       that
445       a group of commands are sent as one dynamic update request to the
446       master name server for
447       <span class="type">example.com</span>.
448
449       </p>
450 <pre class="programlisting">
451 # nsupdate
452 &gt; update delete oldhost.example.com A
453 &gt; update add newhost.example.com 86400 A 172.16.1.1
454 &gt; send
455 </pre>
456 <p>
457     </p>
458 <p>
459       Any A records for
460       <span class="type">oldhost.example.com</span>
461       are deleted.
462       And an A record for
463       <span class="type">newhost.example.com</span>
464       with IP address 172.16.1.1 is added.
465       The newly-added record has a 1 day TTL (86400 seconds).
466       </p>
467 <pre class="programlisting">
468 # nsupdate
469 &gt; prereq nxdomain nickname.example.com
470 &gt; update add nickname.example.com 86400 CNAME somehost.example.com
471 &gt; send
472 </pre>
473 <p>
474     </p>
475 <p>
476       The prerequisite condition gets the name server to check that there
477       are no resource records of any type for
478       <span class="type">nickname.example.com</span>.
479
480       If there are, the update request fails.
481       If this name does not exist, a CNAME for it is added.
482       This ensures that when the CNAME is added, it cannot conflict with the
483       long-standing rule in RFC1034 that a name must not exist as any other
484       record type if it exists as a CNAME.
485       (The rule has been updated for DNSSEC in RFC2535 to allow CNAMEs to have
486       RRSIG, DNSKEY and NSEC records.)
487     </p>
488 </div>
489 <div class="refsect1" lang="en">
490 <a name="id2544611"></a><h2>FILES</h2>
491 <div class="variablelist"><dl>
492 <dt><span class="term"><code class="constant">/etc/resolv.conf</code></span></dt>
493 <dd><p>
494             used to identify default name server
495           </p></dd>
496 <dt><span class="term"><code class="constant">K{name}.+157.+{random}.key</code></span></dt>
497 <dd><p>
498             base-64 encoding of HMAC-MD5 key created by
499             <span class="citerefentry"><span class="refentrytitle">dnssec-keygen</span>(8)</span>.
500           </p></dd>
501 <dt><span class="term"><code class="constant">K{name}.+157.+{random}.private</code></span></dt>
502 <dd><p>
503             base-64 encoding of HMAC-MD5 key created by
504             <span class="citerefentry"><span class="refentrytitle">dnssec-keygen</span>(8)</span>.
505           </p></dd>
506 </dl></div>
507 </div>
508 <div class="refsect1" lang="en">
509 <a name="id2544680"></a><h2>SEE ALSO</h2>
510 <p><span class="citerefentry"><span class="refentrytitle">RFC2136</span></span>,
511       <span class="citerefentry"><span class="refentrytitle">RFC3007</span></span>,
512       <span class="citerefentry"><span class="refentrytitle">RFC2104</span></span>,
513       <span class="citerefentry"><span class="refentrytitle">RFC2845</span></span>,
514       <span class="citerefentry"><span class="refentrytitle">RFC1034</span></span>,
515       <span class="citerefentry"><span class="refentrytitle">RFC2535</span></span>,
516       <span class="citerefentry"><span class="refentrytitle">RFC2931</span></span>,
517       <span class="citerefentry"><span class="refentrytitle">named</span>(8)</span>,
518       <span class="citerefentry"><span class="refentrytitle">dnssec-keygen</span>(8)</span>.
519     </p>
520 </div>
521 <div class="refsect1" lang="en">
522 <a name="id2542156"></a><h2>BUGS</h2>
523 <p>
524       The TSIG key is redundantly stored in two separate files.
525       This is a consequence of nsupdate using the DST library
526       for its cryptographic operations, and may change in future
527       releases.
528     </p>
529 </div>
530 </div></body>
531 </html>