1<!-- 2 - Copyright (C) 2004-2012 Internet Systems Consortium, Inc. ("ISC") 3 - Copyright (C) 2000-2003 Internet Software Consortium. 4 - 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. 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$ --> 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<link rel="start" href="Bv9ARM.html" title="BIND 9 Administrator Reference Manual"> 24<link rel="up" href="Bv9ARM.ch10.html" title="Manual pages"> 25<link rel="prev" href="man.named-journalprint.html" title="named-journalprint"> 26<link rel="next" href="man.rndc.html" title="rndc"> 27</head> 28<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 29<div class="navheader"> 30<table width="100%" summary="Navigation header"> 31<tr><th colspan="3" align="center"><span class="application">nsupdate</span></th></tr> 32<tr> 33<td width="20%" align="left"> 34<a accesskey="p" href="man.named-journalprint.html">Prev</a>�</td> 35<th width="60%" align="center">Manual pages</th> 36<td width="20%" align="right">�<a accesskey="n" href="man.rndc.html">Next</a> 37</td> 38</tr> 39</table> 40<hr> 41</div> 42<div class="refentry" lang="en"> 43<a name="man.nsupdate"></a><div class="titlepage"></div> 44<div class="refnamediv"> 45<h2>Name</h2> 46<p><span class="application">nsupdate</span> — Dynamic DNS update utility</p> 47</div> 48<div class="refsynopsisdiv"> 49<h2>Synopsis</h2> 50<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> 51</div> 52<div class="refsect1" lang="en"> 53<a name="id2639154"></a><h2>DESCRIPTION</h2> 54<p><span><strong class="command">nsupdate</strong></span> 55 is used to submit Dynamic DNS Update requests as defined in RFC 2136 56 to a name server. 57 This allows resource records to be added or removed from a zone 58 without manually editing the zone file. 59 A single update request can contain requests to add or remove more than 60 one 61 resource record. 62 </p> 63<p> 64 Zones that are under dynamic control via 65 <span><strong class="command">nsupdate</strong></span> 66 or a DHCP server should not be edited by hand. 67 Manual edits could 68 conflict with dynamic updates and cause data to be lost. 69 </p> 70<p> 71 The resource records that are dynamically added or removed with 72 <span><strong class="command">nsupdate</strong></span> 73 have to be in the same zone. 74 Requests are sent to the zone's master server. 75 This is identified by the MNAME field of the zone's SOA record. 76 </p> 77<p> 78 The 79 <code class="option">-d</code> 80 option makes 81 <span><strong class="command">nsupdate</strong></span> 82 operate in debug mode. 83 This provides tracing information about the update requests that are 84 made and the replies received from the name server. 85 </p> 86<p> 87 The <code class="option">-D</code> option makes <span><strong class="command">nsupdate</strong></span> 88 report additional debugging information to <code class="option">-d</code>. 89 </p> 90<p> 91 The <code class="option">-L</code> option with an integer argument of zero or 92 higher sets the logging debug level. If zero, logging is disabled. 93 </p> 94<p> 95 Transaction signatures can be used to authenticate the Dynamic 96 DNS updates. These use the TSIG resource record type described 97 in RFC 2845 or the SIG(0) record described in RFC 2535 and 98 RFC 2931 or GSS-TSIG as described in RFC 3645. TSIG relies on 99 a shared secret that should only be known to 100 <span><strong class="command">nsupdate</strong></span> and the name server. Currently, 101 the only supported encryption algorithm for TSIG is HMAC-MD5, 102 which is defined in RFC 2104. Once other algorithms are 103 defined for TSIG, applications will need to ensure they select 104 the appropriate algorithm as well as the key when authenticating 105 each other. For instance, suitable <span class="type">key</span> and 106 <span class="type">server</span> statements would be added to 107 <code class="filename">/etc/named.conf</code> so that the name server 108 can associate the appropriate secret key and algorithm with 109 the IP address of the client application that will be using 110 TSIG authentication. SIG(0) uses public key cryptography. 111 To use a SIG(0) key, the public key must be stored in a KEY 112 record in a zone served by the name server. 113 <span><strong class="command">nsupdate</strong></span> does not read 114 <code class="filename">/etc/named.conf</code>. 115 </p> 116<p> 117 GSS-TSIG uses Kerberos credentials. Standard GSS-TSIG mode 118 is switched on with the <code class="option">-g</code> flag. A 119 non-standards-compliant variant of GSS-TSIG used by Windows 120 2000 can be switched on with the <code class="option">-o</code> flag. 121 </p> 122<p><span><strong class="command">nsupdate</strong></span> 123 uses the <code class="option">-y</code> or <code class="option">-k</code> option 124 to provide the shared secret needed to generate a TSIG record 125 for authenticating Dynamic DNS update requests, default type 126 HMAC-MD5. These options are mutually exclusive. 127 </p> 128<p> 129 When the <code class="option">-y</code> option is used, a signature is 130 generated from 131 [<span class="optional"><em class="parameter"><code>hmac:</code></em></span>]<em class="parameter"><code>keyname:secret.</code></em> 132 <em class="parameter"><code>keyname</code></em> is the name of the key, and 133 <em class="parameter"><code>secret</code></em> is the base64 encoded shared secret. 134 Use of the <code class="option">-y</code> option is discouraged because the 135 shared secret is supplied as a command line argument in clear text. 136 This may be visible in the output from 137 <span class="citerefentry"><span class="refentrytitle">ps</span>(1)</span> 138 or in a history file maintained by the user's shell. 139 </p> 140<p> 141 With the 142 <code class="option">-k</code> option, <span><strong class="command">nsupdate</strong></span> reads 143 the shared secret from the file <em class="parameter"><code>keyfile</code></em>. 144 Keyfiles may be in two formats: a single file containing 145 a <code class="filename">named.conf</code>-format <span><strong class="command">key</strong></span> 146 statement, which may be generated automatically by 147 <span><strong class="command">ddns-confgen</strong></span>, or a pair of files whose names are 148 of the format <code class="filename">K{name}.+157.+{random}.key</code> and 149 <code class="filename">K{name}.+157.+{random}.private</code>, which can be 150 generated by <span><strong class="command">dnssec-keygen</strong></span>. 151 The <code class="option">-k</code> may also be used to specify a SIG(0) key used 152 to authenticate Dynamic DNS update requests. In this case, the key 153 specified is not an HMAC-MD5 key. 154 </p> 155<p> 156 <span><strong class="command">nsupdate</strong></span> can be run in a local-host only mode 157 using the <code class="option">-l</code> flag. This sets the server address to 158 localhost (disabling the <span><strong class="command">server</strong></span> so that the server 159 address cannot be overridden). Connections to the local server will 160 use a TSIG key found in <code class="filename">/var/run/named/session.key</code>, 161 which is automatically generated by <span><strong class="command">named</strong></span> if any 162 local master zone has set <span><strong class="command">update-policy</strong></span> to 163 <span><strong class="command">local</strong></span>. The location of this key file can be 164 overridden with the <code class="option">-k</code> option. 165 </p> 166<p> 167 By default, <span><strong class="command">nsupdate</strong></span> 168 uses UDP to send update requests to the name server unless they are too 169 large to fit in a UDP request in which case TCP will be used. 170 The 171 <code class="option">-v</code> 172 option makes 173 <span><strong class="command">nsupdate</strong></span> 174 use a TCP connection. 175 This may be preferable when a batch of update requests is made. 176 </p> 177<p> 178 The <code class="option">-p</code> sets the default port number to use for 179 connections to a name server. The default is 53. 180 </p> 181<p> 182 The <code class="option">-t</code> option sets the maximum time an update request 183 can 184 take before it is aborted. The default is 300 seconds. Zero can be 185 used 186 to disable the timeout. 187 </p> 188<p> 189 The <code class="option">-u</code> option sets the UDP retry interval. The default 190 is 191 3 seconds. If zero, the interval will be computed from the timeout 192 interval 193 and number of UDP retries. 194 </p> 195<p> 196 The <code class="option">-r</code> option sets the number of UDP retries. The 197 default is 198 3. If zero, only one update request will be made. 199 </p> 200<p> 201 The <code class="option">-R <em class="replaceable"><code>randomdev</code></em></code> option 202 specifies a source of randomness. If the operating system 203 does not provide a <code class="filename">/dev/random</code> or 204 equivalent device, the default source of randomness is keyboard 205 input. <code class="filename">randomdev</code> specifies the name of 206 a character device or file containing random data to be used 207 instead of the default. The special value 208 <code class="filename">keyboard</code> indicates that keyboard input 209 should be used. This option may be specified multiple times. 210 </p> 211</div> 212<div class="refsect1" lang="en"> 213<a name="id2639897"></a><h2>INPUT FORMAT</h2> 214<p><span><strong class="command">nsupdate</strong></span> 215 reads input from 216 <em class="parameter"><code>filename</code></em> 217 or standard input. 218 Each command is supplied on exactly one line of input. 219 Some commands are for administrative purposes. 220 The others are either update instructions or prerequisite checks on the 221 contents of the zone. 222 These checks set conditions that some name or set of 223 resource records (RRset) either exists or is absent from the zone. 224 These conditions must be met if the entire update request is to succeed. 225 Updates will be rejected if the tests for the prerequisite conditions 226 fail. 227 </p> 228<p> 229 Every update request consists of zero or more prerequisites 230 and zero or more updates. 231 This allows a suitably authenticated update request to proceed if some 232 specified resource records are present or missing from the zone. 233 A blank input line (or the <span><strong class="command">send</strong></span> command) 234 causes the 235 accumulated commands to be sent as one Dynamic DNS update request to the 236 name server. 237 </p> 238<p> 239 The command formats and their meaning are as follows: 240 </p> 241<div class="variablelist"><dl> 242<dt><span class="term"> 243 <span><strong class="command">server</strong></span> 244 {servername} 245 [port] 246 </span></dt> 247<dd><p> 248 Sends all dynamic update requests to the name server 249 <em class="parameter"><code>servername</code></em>. 250 When no server statement is provided, 251 <span><strong class="command">nsupdate</strong></span> 252 will send updates to the master server of the correct zone. 253 The MNAME field of that zone's SOA record will identify the 254 master 255 server for that zone. 256 <em class="parameter"><code>port</code></em> 257 is the port number on 258 <em class="parameter"><code>servername</code></em> 259 where the dynamic update requests get sent. 260 If no port number is specified, the default DNS port number of 261 53 is 262 used. 263 </p></dd> 264<dt><span class="term"> 265 <span><strong class="command">local</strong></span> 266 {address} 267 [port] 268 </span></dt> 269<dd><p> 270 Sends all dynamic update requests using the local 271 <em class="parameter"><code>address</code></em>. 272 273 When no local statement is provided, 274 <span><strong class="command">nsupdate</strong></span> 275 will send updates using an address and port chosen by the 276 system. 277 <em class="parameter"><code>port</code></em> 278 can additionally be used to make requests come from a specific 279 port. 280 If no port number is specified, the system will assign one. 281 </p></dd> 282<dt><span class="term"> 283 <span><strong class="command">zone</strong></span> 284 {zonename} 285 </span></dt> 286<dd><p> 287 Specifies that all updates are to be made to the zone 288 <em class="parameter"><code>zonename</code></em>. 289 If no 290 <em class="parameter"><code>zone</code></em> 291 statement is provided, 292 <span><strong class="command">nsupdate</strong></span> 293 will attempt determine the correct zone to update based on the 294 rest of the input. 295 </p></dd> 296<dt><span class="term"> 297 <span><strong class="command">class</strong></span> 298 {classname} 299 </span></dt> 300<dd><p> 301 Specify the default class. 302 If no <em class="parameter"><code>class</code></em> is specified, the 303 default class is 304 <em class="parameter"><code>IN</code></em>. 305 </p></dd> 306<dt><span class="term"> 307 <span><strong class="command">ttl</strong></span> 308 {seconds} 309 </span></dt> 310<dd><p> 311 Specify the default time to live for records to be added. 312 The value <em class="parameter"><code>none</code></em> will clear the default 313 ttl. 314 </p></dd> 315<dt><span class="term"> 316 <span><strong class="command">key</strong></span> 317 {name} 318 {secret} 319 </span></dt> 320<dd><p> 321 Specifies that all updates are to be TSIG-signed using the 322 <em class="parameter"><code>keyname</code></em> <em class="parameter"><code>keysecret</code></em> pair. 323 The <span><strong class="command">key</strong></span> command 324 overrides any key specified on the command line via 325 <code class="option">-y</code> or <code class="option">-k</code>. 326 </p></dd> 327<dt><span class="term"> 328 <span><strong class="command">gsstsig</strong></span> 329 </span></dt> 330<dd><p> 331 Use GSS-TSIG to sign the updated. This is equivalent to 332 specifying <code class="option">-g</code> on the commandline. 333 </p></dd> 334<dt><span class="term"> 335 <span><strong class="command">oldgsstsig</strong></span> 336 </span></dt> 337<dd><p> 338 Use the Windows 2000 version of GSS-TSIG to sign the updated. 339 This is equivalent to specifying <code class="option">-o</code> on the 340 commandline. 341 </p></dd> 342<dt><span class="term"> 343 <span><strong class="command">realm</strong></span> 344 {[<span class="optional">realm_name</span>]} 345 </span></dt> 346<dd><p> 347 When using GSS-TSIG use <em class="parameter"><code>realm_name</code></em> rather 348 than the default realm in <code class="filename">krb5.conf</code>. If no 349 realm is specified the saved realm is cleared. 350 </p></dd> 351<dt><span class="term"> 352 <span><strong class="command">prereq nxdomain</strong></span> 353 {domain-name} 354 </span></dt> 355<dd><p> 356 Requires that no resource record of any type exists with name 357 <em class="parameter"><code>domain-name</code></em>. 358 </p></dd> 359<dt><span class="term"> 360 <span><strong class="command">prereq yxdomain</strong></span> 361 {domain-name} 362 </span></dt> 363<dd><p> 364 Requires that 365 <em class="parameter"><code>domain-name</code></em> 366 exists (has as at least one resource record, of any type). 367 </p></dd> 368<dt><span class="term"> 369 <span><strong class="command">prereq nxrrset</strong></span> 370 {domain-name} 371 [class] 372 {type} 373 </span></dt> 374<dd><p> 375 Requires that no resource record exists of the specified 376 <em class="parameter"><code>type</code></em>, 377 <em class="parameter"><code>class</code></em> 378 and 379 <em class="parameter"><code>domain-name</code></em>. 380 If 381 <em class="parameter"><code>class</code></em> 382 is omitted, IN (internet) is assumed. 383 </p></dd> 384<dt><span class="term"> 385 <span><strong class="command">prereq yxrrset</strong></span> 386 {domain-name} 387 [class] 388 {type} 389 </span></dt> 390<dd><p> 391 This requires that a resource record of the specified 392 <em class="parameter"><code>type</code></em>, 393 <em class="parameter"><code>class</code></em> 394 and 395 <em class="parameter"><code>domain-name</code></em> 396 must exist. 397 If 398 <em class="parameter"><code>class</code></em> 399 is omitted, IN (internet) is assumed. 400 </p></dd> 401<dt><span class="term"> 402 <span><strong class="command">prereq yxrrset</strong></span> 403 {domain-name} 404 [class] 405 {type} 406 {data...} 407 </span></dt> 408<dd><p> 409 The 410 <em class="parameter"><code>data</code></em> 411 from each set of prerequisites of this form 412 sharing a common 413 <em class="parameter"><code>type</code></em>, 414 <em class="parameter"><code>class</code></em>, 415 and 416 <em class="parameter"><code>domain-name</code></em> 417 are combined to form a set of RRs. This set of RRs must 418 exactly match the set of RRs existing in the zone at the 419 given 420 <em class="parameter"><code>type</code></em>, 421 <em class="parameter"><code>class</code></em>, 422 and 423 <em class="parameter"><code>domain-name</code></em>. 424 The 425 <em class="parameter"><code>data</code></em> 426 are written in the standard text representation of the resource 427 record's 428 RDATA. 429 </p></dd> 430<dt><span class="term"> 431 <span><strong class="command">update delete</strong></span> 432 {domain-name} 433 [ttl] 434 [class] 435 [type [data...]] 436 </span></dt> 437<dd><p> 438 Deletes any resource records named 439 <em class="parameter"><code>domain-name</code></em>. 440 If 441 <em class="parameter"><code>type</code></em> 442 and 443 <em class="parameter"><code>data</code></em> 444 is provided, only matching resource records will be removed. 445 The internet class is assumed if 446 <em class="parameter"><code>class</code></em> 447 is not supplied. The 448 <em class="parameter"><code>ttl</code></em> 449 is ignored, and is only allowed for compatibility. 450 </p></dd> 451<dt><span class="term"> 452 <span><strong class="command">update add</strong></span> 453 {domain-name} 454 {ttl} 455 [class] 456 {type} 457 {data...} 458 </span></dt> 459<dd><p> 460 Adds a new resource record with the specified 461 <em class="parameter"><code>ttl</code></em>, 462 <em class="parameter"><code>class</code></em> 463 and 464 <em class="parameter"><code>data</code></em>. 465 </p></dd> 466<dt><span class="term"> 467 <span><strong class="command">show</strong></span> 468 </span></dt> 469<dd><p> 470 Displays the current message, containing all of the 471 prerequisites and 472 updates specified since the last send. 473 </p></dd> 474<dt><span class="term"> 475 <span><strong class="command">send</strong></span> 476 </span></dt> 477<dd><p> 478 Sends the current message. This is equivalent to entering a 479 blank line. 480 </p></dd> 481<dt><span class="term"> 482 <span><strong class="command">answer</strong></span> 483 </span></dt> 484<dd><p> 485 Displays the answer. 486 </p></dd> 487<dt><span class="term"> 488 <span><strong class="command">debug</strong></span> 489 </span></dt> 490<dd><p> 491 Turn on debugging. 492 </p></dd> 493</dl></div> 494<p> 495 </p> 496<p> 497 Lines beginning with a semicolon are comments and are ignored. 498 </p> 499</div> 500<div class="refsect1" lang="en"> 501<a name="id2678629"></a><h2>EXAMPLES</h2> 502<p> 503 The examples below show how 504 <span><strong class="command">nsupdate</strong></span> 505 could be used to insert and delete resource records from the 506 <span class="type">example.com</span> 507 zone. 508 Notice that the input in each example contains a trailing blank line so 509 that 510 a group of commands are sent as one dynamic update request to the 511 master name server for 512 <span class="type">example.com</span>. 513 514 </p> 515<pre class="programlisting"> 516# nsupdate 517> update delete oldhost.example.com A 518> update add newhost.example.com 86400 A 172.16.1.1 519> send 520</pre> 521<p> 522 </p> 523<p> 524 Any A records for 525 <span class="type">oldhost.example.com</span> 526 are deleted. 527 And an A record for 528 <span class="type">newhost.example.com</span> 529 with IP address 172.16.1.1 is added. 530 The newly-added record has a 1 day TTL (86400 seconds). 531 </p> 532<pre class="programlisting"> 533# nsupdate 534> prereq nxdomain nickname.example.com 535> update add nickname.example.com 86400 CNAME somehost.example.com 536> send 537</pre> 538<p> 539 </p> 540<p> 541 The prerequisite condition gets the name server to check that there 542 are no resource records of any type for 543 <span class="type">nickname.example.com</span>. 544 545 If there are, the update request fails. 546 If this name does not exist, a CNAME for it is added. 547 This ensures that when the CNAME is added, it cannot conflict with the 548 long-standing rule in RFC 1034 that a name must not exist as any other 549 record type if it exists as a CNAME. 550 (The rule has been updated for DNSSEC in RFC 2535 to allow CNAMEs to have 551 RRSIG, DNSKEY and NSEC records.) 552 </p> 553</div> 554<div class="refsect1" lang="en"> 555<a name="id2678679"></a><h2>FILES</h2> 556<div class="variablelist"><dl> 557<dt><span class="term"><code class="constant">/etc/resolv.conf</code></span></dt> 558<dd><p> 559 used to identify default name server 560 </p></dd> 561<dt><span class="term"><code class="constant">/var/run/named/session.key</code></span></dt> 562<dd><p> 563 sets the default TSIG key for use in local-only mode 564 </p></dd> 565<dt><span class="term"><code class="constant">K{name}.+157.+{random}.key</code></span></dt> 566<dd><p> 567 base-64 encoding of HMAC-MD5 key created by 568 <span class="citerefentry"><span class="refentrytitle">dnssec-keygen</span>(8)</span>. 569 </p></dd> 570<dt><span class="term"><code class="constant">K{name}.+157.+{random}.private</code></span></dt> 571<dd><p> 572 base-64 encoding of HMAC-MD5 key created by 573 <span class="citerefentry"><span class="refentrytitle">dnssec-keygen</span>(8)</span>. 574 </p></dd> 575</dl></div> 576</div> 577<div class="refsect1" lang="en"> 578<a name="id2678762"></a><h2>SEE ALSO</h2> 579<p> 580 <em class="citetitle">RFC 2136</em>, 581 <em class="citetitle">RFC 3007</em>, 582 <em class="citetitle">RFC 2104</em>, 583 <em class="citetitle">RFC 2845</em>, 584 <em class="citetitle">RFC 1034</em>, 585 <em class="citetitle">RFC 2535</em>, 586 <em class="citetitle">RFC 2931</em>, 587 <span class="citerefentry"><span class="refentrytitle">named</span>(8)</span>, 588 <span class="citerefentry"><span class="refentrytitle">ddns-confgen</span>(8)</span>, 589 <span class="citerefentry"><span class="refentrytitle">dnssec-keygen</span>(8)</span>. 590 </p> 591</div> 592<div class="refsect1" lang="en"> 593<a name="id2678820"></a><h2>BUGS</h2> 594<p> 595 The TSIG key is redundantly stored in two separate files. 596 This is a consequence of nsupdate using the DST library 597 for its cryptographic operations, and may change in future 598 releases. 599 </p> 600</div> 601</div> 602<div class="navfooter"> 603<hr> 604<table width="100%" summary="Navigation footer"> 605<tr> 606<td width="40%" align="left"> 607<a accesskey="p" href="man.named-journalprint.html">Prev</a>�</td> 608<td width="20%" align="center"><a accesskey="u" href="Bv9ARM.ch10.html">Up</a></td> 609<td width="40%" align="right">�<a accesskey="n" href="man.rndc.html">Next</a> 610</td> 611</tr> 612<tr> 613<td width="40%" align="left" valign="top"> 614<span class="application">named-journalprint</span>�</td> 615<td width="20%" align="center"><a accesskey="h" href="Bv9ARM.html">Home</a></td> 616<td width="40%" align="right" valign="top">�<span class="application">rndc</span> 617</td> 618</tr> 619</table> 620</div> 621</body> 622</html> 623