nsupdate.html revision 4abdfc917e6635a7c81d1f931a0c79227e72d025
325N/A<!--
325N/A - Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC")
325N/A - Copyright (C) 2000-2003 Internet Software Consortium.
325N/A -
325N/A - Permission to use, copy, modify, and distribute this software for any
325N/A - purpose with or without fee is hereby granted, provided that the above
325N/A - copyright notice and this permission notice appear in all copies.
325N/A -
325N/A - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
325N/A - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
325N/A - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
325N/A - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
325N/A - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
325N/A - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
325N/A - PERFORMANCE OF THIS SOFTWARE.
325N/A-->
325N/A<!-- $Id: nsupdate.html,v 1.34 2007/01/26 23:29:04 marka Exp $ -->
325N/A<html>
325N/A<head>
325N/A<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
325N/A<title>nsupdate</title>
325N/A<meta name="generator" content="DocBook XSL Stylesheets V1.71.1">
325N/A</head>
325N/A<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
325N/A<a name="id2476275"></a><div class="titlepage"></div>
325N/A<div class="refnamediv">
325N/A<h2>Name</h2>
325N/A<p>nsupdate &#8212; Dynamic DNS update utility</p>
325N/A</div>
325N/A<div class="refsynopsisdiv">
325N/A<h2>Synopsis</h2>
325N/A<div class="cmdsynopsis"><p><code class="command">nsupdate</code> [<code class="option">-d</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">-v</code>] [filename]</p></div>
325N/A</div>
325N/A<div class="refsect1" lang="en">
325N/A<a name="id2543414"></a><h2>DESCRIPTION</h2>
325N/A<p><span><strong class="command">nsupdate</strong></span>
325N/A is used to submit Dynamic DNS Update requests as defined in RFC2136
325N/A to a name server.
325N/A This allows resource records to be added or removed from a zone
325N/A without manually editing the zone file.
325N/A A single update request can contain requests to add or remove more than
325N/A one
325N/A resource record.
325N/A </p>
325N/A<p>
325N/A Zones that are under dynamic control via
325N/A <span><strong class="command">nsupdate</strong></span>
325N/A or a DHCP server should not be edited by hand.
325N/A Manual edits could
325N/A conflict with dynamic updates and cause data to be lost.
325N/A </p>
325N/A<p>
325N/A The resource records that are dynamically added or removed with
325N/A <span><strong class="command">nsupdate</strong></span>
325N/A have to be in the same zone.
325N/A Requests are sent to the zone's master server.
325N/A This is identified by the MNAME field of the zone's SOA record.
325N/A </p>
325N/A<p>
325N/A The
325N/A <code class="option">-d</code>
325N/A option makes
325N/A <span><strong class="command">nsupdate</strong></span>
325N/A operate in debug mode.
325N/A This provides tracing information about the update requests that are
325N/A made and the replies received from the name server.
325N/A </p>
325N/A<p>
325N/A Transaction signatures can be used to authenticate the Dynamic DNS
325N/A updates.
325N/A These use the TSIG resource record type described in RFC2845 or the
325N/A SIG(0) record described in RFC3535 and RFC2931.
325N/A TSIG relies on a shared secret that should only be known to
325N/A <span><strong class="command">nsupdate</strong></span> and the name server.
325N/A Currently, the only supported encryption algorithm for TSIG is
325N/A HMAC-MD5, which is defined in RFC 2104.
325N/A Once other algorithms are defined for TSIG, applications will need to
325N/A ensure they select the appropriate algorithm as well as the key when
325N/A authenticating each other.
325N/A For instance suitable
325N/A <span class="type">key</span>
325N/A and
325N/A <span class="type">server</span>
325N/A statements would be added to
325N/A <code class="filename">/etc/named.conf</code>
325N/A so that the name server can associate the appropriate secret key
325N/A and algorithm with the IP address of the
325N/A client application that will be using TSIG authentication.
325N/A SIG(0) uses public key cryptography. To use a SIG(0) key, the public
325N/A key must be stored in a KEY record in a zone served by the name server.
325N/A <span><strong class="command">nsupdate</strong></span>
325N/A does not read
325N/A <code class="filename">/etc/named.conf</code>.
325N/A </p>
325N/A<p><span><strong class="command">nsupdate</strong></span>
325N/A uses the <code class="option">-y</code> or <code class="option">-k</code> option
325N/A to provide the shared secret needed to generate a TSIG record
325N/A for authenticating Dynamic DNS update requests, default type
325N/A HMAC-MD5. These options are mutually exclusive. With the
325N/A <code class="option">-k</code> option, <span><strong class="command">nsupdate</strong></span> reads
325N/A the shared secret from the file <em class="parameter"><code>keyfile</code></em>,
325N/A whose name is of the form
325N/A <code class="filename">K{name}.+157.+{random}.private</code>. For
325N/A historical reasons, the file
325N/A <code class="filename">K{name}.+157.+{random}.key</code> must also be
325N/A present. When the <code class="option">-y</code> option is used, a
325N/A signature is generated from
325N/A [<span class="optional"><em class="parameter"><code>hmac:</code></em></span>]<em class="parameter"><code>keyname:secret.</code></em>
325N/A <em class="parameter"><code>keyname</code></em> is the name of the key, and
325N/A <em class="parameter"><code>secret</code></em> is the base64 encoded shared
325N/A secret. Use of the <code class="option">-y</code> option is discouraged
325N/A because the shared secret is supplied as a command line
325N/A argument in clear text. This may be visible in the output
325N/A from
325N/A <span class="citerefentry"><span class="refentrytitle">ps</span>(1)</span> or in a history file maintained by the user's
325N/A shell.
325N/A </p>
325N/A<p>
325N/A The <code class="option">-k</code> may also be used to specify a SIG(0) key used
325N/A to authenticate Dynamic DNS update requests. In this case, the key
325N/A specified is not an HMAC-MD5 key.
325N/A </p>
325N/A<p>
325N/A By default
325N/A <span><strong class="command">nsupdate</strong></span>
325N/A uses UDP to send update requests to the name server unless they are too
325N/A large to fit in a UDP request in which case TCP will be used.
325N/A The
325N/A <code class="option">-v</code>
325N/A option makes
325N/A <span><strong class="command">nsupdate</strong></span>
325N/A use a TCP connection.
325N/A This may be preferable when a batch of update requests is made.
325N/A </p>
325N/A<p>
325N/A The <code class="option">-t</code> option sets the maximum time a update request
325N/A can
325N/A take before it is aborted. The default is 300 seconds. Zero can be
325N/A used
325N/A to disable the timeout.
325N/A </p>
325N/A<p>
325N/A The <code class="option">-u</code> option sets the UDP retry interval. The default
325N/A is
325N/A 3 seconds. If zero the interval will be computed from the timeout
325N/A interval
325N/A and number of UDP retries.
325N/A </p>
325N/A<p>
325N/A The <code class="option">-r</code> option sets the number of UDP retries. The
325N/A default is
325N/A 3. If zero only one update request will be made.
325N/A </p>
325N/A</div>
325N/A<div class="refsect1" lang="en">
325N/A<a name="id2543642"></a><h2>INPUT FORMAT</h2>
325N/A<p><span><strong class="command">nsupdate</strong></span>
325N/A reads input from
325N/A <em class="parameter"><code>filename</code></em>
325N/A or standard input.
325N/A Each command is supplied on exactly one line of input.
325N/A Some commands are for administrative purposes.
325N/A The others are either update instructions or prerequisite checks on the
325N/A contents of the zone.
325N/A These checks set conditions that some name or set of
325N/A resource records (RRset) either exists or is absent from the zone.
325N/A These conditions must be met if the entire update request is to succeed.
325N/A Updates will be rejected if the tests for the prerequisite conditions
325N/A fail.
325N/A </p>
325N/A<p>
325N/A Every update request consists of zero or more prerequisites
325N/A and zero or more updates.
325N/A This allows a suitably authenticated update request to proceed if some
325N/A specified resource records are present or missing from the zone.
325N/A A blank input line (or the <span><strong class="command">send</strong></span> command)
325N/A causes the
325N/A accumulated commands to be sent as one Dynamic DNS update request to the
325N/A name server.
325N/A </p>
325N/A<p>
325N/A The command formats and their meaning are as follows:
325N/A </p>
325N/A<div class="variablelist"><dl>
325N/A<dt><span class="term">
325N/A <span><strong class="command">server</strong></span>
325N/A {servername}
325N/A [port]
325N/A </span></dt>
325N/A<dd><p>
325N/A Sends all dynamic update requests to the name server
325N/A <em class="parameter"><code>servername</code></em>.
325N/A When no server statement is provided,
325N/A <span><strong class="command">nsupdate</strong></span>
325N/A will send updates to the master server of the correct zone.
325N/A The MNAME field of that zone's SOA record will identify the
325N/A master
325N/A server for that zone.
325N/A <em class="parameter"><code>port</code></em>
325N/A is the port number on
325N/A <em class="parameter"><code>servername</code></em>
325N/A where the dynamic update requests get sent.
325N/A If no port number is specified, the default DNS port number of
325N/A 53 is
325N/A used.
325N/A </p></dd>
325N/A<dt><span class="term">
325N/A <span><strong class="command">local</strong></span>
325N/A {address}
325N/A [port]
325N/A </span></dt>
325N/A<dd><p>
325N/A Sends all dynamic update requests using the local
325N/A <em class="parameter"><code>address</code></em>.
325N/A
325N/A When no local statement is provided,
325N/A <span><strong class="command">nsupdate</strong></span>
325N/A will send updates using an address and port chosen by the
325N/A system.
325N/A <em class="parameter"><code>port</code></em>
325N/A can additionally be used to make requests come from a specific
325N/A port.
325N/A If no port number is specified, the system will assign one.
325N/A </p></dd>
325N/A<dt><span class="term">
325N/A <span><strong class="command">zone</strong></span>
325N/A {zonename}
325N/A </span></dt>
325N/A<dd><p>
325N/A Specifies that all updates are to be made to the zone
325N/A <em class="parameter"><code>zonename</code></em>.
325N/A If no
325N/A <em class="parameter"><code>zone</code></em>
325N/A statement is provided,
325N/A <span><strong class="command">nsupdate</strong></span>
325N/A will attempt determine the correct zone to update based on the
325N/A rest of the input.
325N/A </p></dd>
325N/A<dt><span class="term">
325N/A <span><strong class="command">class</strong></span>
325N/A {classname}
325N/A </span></dt>
325N/A<dd><p>
325N/A Specify the default class.
325N/A If no <em class="parameter"><code>class</code></em> is specified the
325N/A default class is
325N/A <em class="parameter"><code>IN</code></em>.
325N/A </p></dd>
325N/A<dt><span class="term">
325N/A <span><strong class="command">key</strong></span>
325N/A {name}
325N/A {secret}
325N/A </span></dt>
325N/A<dd><p>
325N/A Specifies that all updates are to be TSIG signed using the
325N/A <em class="parameter"><code>keyname</code></em> <em class="parameter"><code>keysecret</code></em> pair.
325N/A The <span><strong class="command">key</strong></span> command
325N/A overrides any key specified on the command line via
325N/A <code class="option">-y</code> or <code class="option">-k</code>.
325N/A </p></dd>
325N/A<dt><span class="term">
325N/A <span><strong class="command">prereq nxdomain</strong></span>
325N/A {domain-name}
325N/A </span></dt>
325N/A<dd><p>
325N/A Requires that no resource record of any type exists with name
325N/A <em class="parameter"><code>domain-name</code></em>.
325N/A </p></dd>
325N/A<dt><span class="term">
325N/A <span><strong class="command">prereq yxdomain</strong></span>
325N/A {domain-name}
325N/A </span></dt>
325N/A<dd><p>
325N/A Requires that
325N/A <em class="parameter"><code>domain-name</code></em>
325N/A exists (has as at least one resource record, of any type).
325N/A </p></dd>
325N/A<dt><span class="term">
325N/A <span><strong class="command">prereq nxrrset</strong></span>
325N/A {domain-name}
325N/A [class]
325N/A {type}
325N/A </span></dt>
325N/A<dd><p>
325N/A Requires that no resource record exists of the specified
325N/A <em class="parameter"><code>type</code></em>,
325N/A <em class="parameter"><code>class</code></em>
325N/A and
325N/A <em class="parameter"><code>domain-name</code></em>.
325N/A If
325N/A <em class="parameter"><code>class</code></em>
325N/A is omitted, IN (internet) is assumed.
325N/A </p></dd>
325N/A<dt><span class="term">
325N/A <span><strong class="command">prereq yxrrset</strong></span>
325N/A {domain-name}
325N/A [class]
325N/A {type}
325N/A </span></dt>
325N/A<dd><p>
325N/A This requires that a resource record of the specified
325N/A <em class="parameter"><code>type</code></em>,
325N/A <em class="parameter"><code>class</code></em>
325N/A and
325N/A <em class="parameter"><code>domain-name</code></em>
325N/A must exist.
325N/A If
325N/A <em class="parameter"><code>class</code></em>
325N/A is omitted, IN (internet) is assumed.
325N/A </p></dd>
325N/A<dt><span class="term">
325N/A <span><strong class="command">prereq yxrrset</strong></span>
325N/A {domain-name}
325N/A [class]
325N/A {type}
325N/A {data...}
325N/A </span></dt>
325N/A<dd><p>
325N/A The
325N/A <em class="parameter"><code>data</code></em>
325N/A from each set of prerequisites of this form
325N/A sharing a common
325N/A <em class="parameter"><code>type</code></em>,
325N/A <em class="parameter"><code>class</code></em>,
325N/A and
325N/A <em class="parameter"><code>domain-name</code></em>
325N/A are combined to form a set of RRs. This set of RRs must
325N/A exactly match the set of RRs existing in the zone at the
325N/A given
325N/A <em class="parameter"><code>type</code></em>,
325N/A <em class="parameter"><code>class</code></em>,
325N/A and
325N/A <em class="parameter"><code>domain-name</code></em>.
325N/A The
325N/A <em class="parameter"><code>data</code></em>
325N/A are written in the standard text representation of the resource
325N/A record's
325N/A RDATA.
325N/A </p></dd>
325N/A<dt><span class="term">
325N/A <span><strong class="command">update delete</strong></span>
325N/A {domain-name}
325N/A [ttl]
325N/A [class]
325N/A [type [data...]]
325N/A </span></dt>
325N/A<dd><p>
325N/A Deletes any resource records named
325N/A <em class="parameter"><code>domain-name</code></em>.
325N/A If
325N/A <em class="parameter"><code>type</code></em>
325N/A and
325N/A <em class="parameter"><code>data</code></em>
325N/A is provided, only matching resource records will be removed.
325N/A The internet class is assumed if
325N/A <em class="parameter"><code>class</code></em>
325N/A is not supplied. The
325N/A <em class="parameter"><code>ttl</code></em>
325N/A is ignored, and is only allowed for compatibility.
325N/A </p></dd>
325N/A<dt><span class="term">
325N/A <span><strong class="command">update add</strong></span>
325N/A {domain-name}
325N/A {ttl}
325N/A [class]
325N/A {type}
325N/A {data...}
325N/A </span></dt>
325N/A<dd><p>
325N/A Adds a new resource record with the specified
325N/A <em class="parameter"><code>ttl</code></em>,
325N/A <em class="parameter"><code>class</code></em>
325N/A and
325N/A <em class="parameter"><code>data</code></em>.
325N/A </p></dd>
325N/A<dt><span class="term">
325N/A <span><strong class="command">show</strong></span>
325N/A </span></dt>
325N/A<dd><p>
325N/A Displays the current message, containing all of the
325N/A prerequisites and
325N/A updates specified since the last send.
325N/A </p></dd>
325N/A<dt><span class="term">
325N/A <span><strong class="command">send</strong></span>
325N/A </span></dt>
325N/A<dd><p>
325N/A Sends the current message. This is equivalent to entering a
325N/A blank line.
325N/A </p></dd>
325N/A<dt><span class="term">
325N/A <span><strong class="command">answer</strong></span>
325N/A </span></dt>
325N/A<dd><p>
325N/A Displays the answer.
325N/A </p></dd>
325N/A</dl></div>
325N/A<p>
325N/A </p>
325N/A<p>
Lines beginning with a semicolon are comments and are ignored.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2544646"></a><h2>EXAMPLES</h2>
<p>
The examples below show how
<span><strong class="command">nsupdate</strong></span>
could be used to insert and delete resource records from the
<span class="type">example.com</span>
zone.
Notice that the input in each example contains a trailing blank line so
that
a group of commands are sent as one dynamic update request to the
master name server for
<span class="type">example.com</span>.
</p>
<pre class="programlisting">
# nsupdate
&gt; update delete oldhost.example.com A
&gt; update add newhost.example.com 86400 A 172.16.1.1
&gt; send
</pre>
<p>
</p>
<p>
Any A records for
<span class="type">oldhost.example.com</span>
are deleted.
and an A record for
<span class="type">newhost.example.com</span>
it IP address 172.16.1.1 is added.
The newly-added record has a 1 day TTL (86400 seconds)
</p>
<pre class="programlisting">
# nsupdate
&gt; prereq nxdomain nickname.example.com
&gt; update add nickname.example.com 86400 CNAME somehost.example.com
&gt; send
</pre>
<p>
</p>
<p>
The prerequisite condition gets the name server to check that there
are no resource records of any type for
<span class="type">nickname.example.com</span>.
If there are, the update request fails.
If this name does not exist, a CNAME for it is added.
This ensures that when the CNAME is added, it cannot conflict with the
long-standing rule in RFC1034 that a name must not exist as any other
record type if it exists as a CNAME.
(The rule has been updated for DNSSEC in RFC2535 to allow CNAMEs to have
RRSIG, DNSKEY and NSEC records.)
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2544690"></a><h2>FILES</h2>
<div class="variablelist"><dl>
<dt><span class="term"><code class="constant">/etc/resolv.conf</code></span></dt>
<dd><p>
used to identify default name server
</p></dd>
<dt><span class="term"><code class="constant">K{name}.+157.+{random}.key</code></span></dt>
<dd><p>
base-64 encoding of HMAC-MD5 key created by
<span class="citerefentry"><span class="refentrytitle">dnssec-keygen</span>(8)</span>.
</p></dd>
<dt><span class="term"><code class="constant">K{name}.+157.+{random}.private</code></span></dt>
<dd><p>
base-64 encoding of HMAC-MD5 key created by
<span class="citerefentry"><span class="refentrytitle">dnssec-keygen</span>(8)</span>.
</p></dd>
</dl></div>
</div>
<div class="refsect1" lang="en">
<a name="id2544827"></a><h2>SEE ALSO</h2>
<p><span class="citerefentry"><span class="refentrytitle">RFC2136</span></span>,
<span class="citerefentry"><span class="refentrytitle">RFC3007</span></span>,
<span class="citerefentry"><span class="refentrytitle">RFC2104</span></span>,
<span class="citerefentry"><span class="refentrytitle">RFC2845</span></span>,
<span class="citerefentry"><span class="refentrytitle">RFC1034</span></span>,
<span class="citerefentry"><span class="refentrytitle">RFC2535</span></span>,
<span class="citerefentry"><span class="refentrytitle">RFC2931</span></span>,
<span class="citerefentry"><span class="refentrytitle">named</span>(8)</span>,
<span class="citerefentry"><span class="refentrytitle">dnssec-keygen</span>(8)</span>.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2544898"></a><h2>BUGS</h2>
<p>
The TSIG key is redundantly stored in two separate files.
This is a consequence of nsupdate using the DST library
for its cryptographic operations, and may change in future
releases.
</p>
</div>
</div></body>
</html>