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