nsupdate.docbook revision de10c46b2a714b0fb74837da7867f55cccc6d261
4632N/A<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
4632N/A "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
4632N/A [<!ENTITY mdash "&#8212;">]>
4632N/A<!--
4632N/A - Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
4632N/A - Copyright (C) 2000-2003 Internet Software Consortium.
4632N/A -
4632N/A - Permission to use, copy, modify, and/or distribute this software for any
4632N/A - purpose with or without fee is hereby granted, provided that the above
4632N/A - copyright notice and this permission notice appear in all copies.
4632N/A -
4632N/A - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
4632N/A - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
4632N/A - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
4632N/A - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
4632N/A - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
4632N/A - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
4632N/A - PERFORMANCE OF THIS SOFTWARE.
4632N/A-->
4632N/A
4632N/A<!-- $Id: nsupdate.docbook,v 1.40 2009/08/26 21:34:44 jreed Exp $ -->
4632N/A<refentry id="man.nsupdate">
4632N/A <refentryinfo>
4632N/A <date>Aug 25, 2009</date>
4632N/A </refentryinfo>
4632N/A <refmeta>
4632N/A <refentrytitle><application>nsupdate</application></refentrytitle>
4632N/A <manvolnum>1</manvolnum>
4632N/A <refmiscinfo>BIND9</refmiscinfo>
4632N/A </refmeta>
4632N/A <refnamediv>
4632N/A <refname><application>nsupdate</application></refname>
4632N/A <refpurpose>Dynamic DNS update utility</refpurpose>
4632N/A </refnamediv>
4632N/A
4632N/A <docinfo>
4632N/A <copyright>
4632N/A <year>2004</year>
5332N/A <year>2005</year>
4632N/A <year>2006</year>
4632N/A <year>2007</year>
4632N/A <year>2008</year>
4632N/A <year>2009</year>
4632N/A <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
4632N/A </copyright>
4632N/A <copyright>
4632N/A <year>2000</year>
4632N/A <year>2001</year>
4632N/A <year>2002</year>
4632N/A <year>2003</year>
4632N/A <holder>Internet Software Consortium.</holder>
4632N/A </copyright>
4632N/A </docinfo>
4632N/A
4632N/A <refsynopsisdiv>
4632N/A <cmdsynopsis>
4632N/A <command>nsupdate</command>
4632N/A <arg><option>-d</option></arg>
4632N/A <arg><option>-D</option></arg>
4632N/A <group>
4632N/A <arg><option>-g</option></arg>
4632N/A <arg><option>-o</option></arg>
4632N/A <arg><option>-l</option></arg>
4632N/A <arg><option>-y <replaceable class="parameter"><optional>hmac:</optional>keyname:secret</replaceable></option></arg>
4632N/A <arg><option>-k <replaceable class="parameter">keyfile</replaceable></option></arg>
4632N/A </group>
4632N/A <arg><option>-t <replaceable class="parameter">timeout</replaceable></option></arg>
4632N/A <arg><option>-u <replaceable class="parameter">udptimeout</replaceable></option></arg>
4632N/A <arg><option>-r <replaceable class="parameter">udpretries</replaceable></option></arg>
4632N/A <arg><option>-R <replaceable class="parameter">randomdev</replaceable></option></arg>
4632N/A <arg><option>-v</option></arg>
4632N/A <arg>filename</arg>
4632N/A </cmdsynopsis>
4632N/A </refsynopsisdiv>
4632N/A
4632N/A <refsect1>
4632N/A <title>DESCRIPTION</title>
4632N/A <para><command>nsupdate</command>
4632N/A is used to submit Dynamic DNS Update requests as defined in RFC2136
4632N/A to a name server.
4632N/A This allows resource records to be added or removed from a zone
4632N/A without manually editing the zone file.
4632N/A A single update request can contain requests to add or remove more than
4632N/A one
4632N/A resource record.
4632N/A </para>
4632N/A <para>
4632N/A Zones that are under dynamic control via
4632N/A <command>nsupdate</command>
4632N/A or a DHCP server should not be edited by hand.
4632N/A Manual edits could
4632N/A conflict with dynamic updates and cause data to be lost.
4632N/A </para>
4632N/A <para>
4632N/A The resource records that are dynamically added or removed with
4632N/A <command>nsupdate</command>
4632N/A have to be in the same zone.
4632N/A Requests are sent to the zone's master server.
4632N/A This is identified by the MNAME field of the zone's SOA record.
4632N/A </para>
4632N/A <para>
4632N/A The
4632N/A <option>-d</option>
4632N/A option makes
4632N/A <command>nsupdate</command>
4632N/A operate in debug mode.
4632N/A This provides tracing information about the update requests that are
4632N/A made and the replies received from the name server.
4632N/A </para>
4632N/A <para>
4632N/A The <option>-D</option> option makes <command>nsupdate</command>
4632N/A report additional debugging information to <option>-d</option>.
5332N/A </para>
5332N/A <para>
5332N/A The <option>-L</option> option with an integer argument of zero or
5332N/A higher sets the logging debug level. If zero, logging is disabled.
4632N/A </para>
5332N/A <para>
5332N/A Transaction signatures can be used to authenticate the Dynamic
5332N/A DNS updates. These use the TSIG resource record type described
5332N/A in RFC2845 or the SIG(0) record described in RFC3535 and
5332N/A RFC2931 or GSS-TSIG as described in RFC3645. TSIG relies on
5332N/A a shared secret that should only be known to
4632N/A <command>nsupdate</command> and the name server. Currently,
4632N/A the only supported encryption algorithm for TSIG is HMAC-MD5,
4632N/A which is defined in RFC 2104. Once other algorithms are
4632N/A defined for TSIG, applications will need to ensure they select
4632N/A the appropriate algorithm as well as the key when authenticating
4632N/A each other. For instance, suitable <type>key</type> and
4632N/A <type>server</type> statements would be added to
4632N/A <filename>/etc/named.conf</filename> so that the name server
4632N/A can associate the appropriate secret key and algorithm with
4632N/A the IP address of the client application that will be using
4632N/A TSIG authentication. SIG(0) uses public key cryptography.
4632N/A To use a SIG(0) key, the public key must be stored in a KEY
4632N/A record in a zone served by the name server.
4632N/A <command>nsupdate</command> does not read
4632N/A <filename>/etc/named.conf</filename>.
4632N/A GSS-TSIG uses Kerberos credentials.
4632N/A </para>
4632N/A <para><command>nsupdate</command>
4632N/A uses the <option>-y</option> or <option>-k</option> option
4632N/A to provide the shared secret needed to generate a TSIG record
4632N/A for authenticating Dynamic DNS update requests, default type
4632N/A HMAC-MD5. These options are mutually exclusive.
4632N/A </para>
4632N/A <para>
4632N/A When the <option>-y</option> option is used, a signature is
4632N/A generated from
4632N/A <optional><parameter>hmac:</parameter></optional><parameter>keyname:secret.</parameter>
4632N/A <parameter>keyname</parameter> is the name of the key, and
4632N/A <parameter>secret</parameter> is the base64 encoded shared secret.
4632N/A Use of the <option>-y</option> option is discouraged because the
4632N/A shared secret is supplied as a command line argument in clear text.
4632N/A This may be visible in the output from
4632N/A <citerefentry>
4632N/A <refentrytitle>ps</refentrytitle><manvolnum>1</manvolnum>
4632N/A </citerefentry>
4632N/A or in a history file maintained by the user's shell.
4632N/A </para>
4632N/A <para>
4632N/A With the
4632N/A <option>-k</option> option, <command>nsupdate</command> reads
4632N/A the shared secret from the file <parameter>keyfile</parameter>.
4632N/A Keyfiles may be in two formats: a single file containing
4632N/A a <filename>named.conf</filename>-format <command>key</command>
4632N/A statement, which may be generated automatically by
4632N/A <command>ddns-confgen</command>, or a pair of files whose names are
4632N/A of the format <filename>K{name}.+157.+{random}.key</filename> and
4632N/A <filename>K{name}.+157.+{random}.private</filename>, which can be
4632N/A generated by <command>dnssec-keygen</command>.
4632N/A The <option>-k</option> may also be used to specify a SIG(0) key used
4632N/A to authenticate Dynamic DNS update requests. In this case, the key
4632N/A specified is not an HMAC-MD5 key.
4632N/A </para>
4632N/A <para>
4632N/A <command>nsupdate</command> can be run in a local-host only mode
4632N/A using the <option>-l</option> flag. This sets the server address to
4632N/A localhost (disabling the <command>server</command> so that the server
4632N/A address cannot be overridden). Connections to the local server will
4632N/A use a TSIG key found in <filename>/var/run/named/ddns.key</filename>,
4632N/A which is automatically generated by <command>named</command> if any
4632N/A local master zone has set <command>update-policy</command> to
4632N/A <command>local</command>. The location of this key file can be
4632N/A overridden with the <option>-k</option> option.
4632N/A </para>
4632N/A <para>
4632N/A By default, <command>nsupdate</command>
4632N/A uses UDP to send update requests to the name server unless they are too
4632N/A large to fit in a UDP request in which case TCP will be used.
4632N/A The
4632N/A <option>-v</option>
4632N/A option makes
4632N/A <command>nsupdate</command>
4632N/A use a TCP connection.
4632N/A This may be preferable when a batch of update requests is made.
4632N/A </para>
4632N/A <para>
4632N/A The <option>-p</option> sets the default port number to use for
4632N/A connections to a name server. The default is 53.
4632N/A </para>
4632N/A <para>
4632N/A The <option>-t</option> option sets the maximum time an update request
4632N/A can
4632N/A take before it is aborted. The default is 300 seconds. Zero can be
4632N/A used
4632N/A to disable the timeout.
4632N/A </para>
4632N/A <para>
4632N/A The <option>-u</option> option sets the UDP retry interval. The default
4632N/A is
4632N/A 3 seconds. If zero, the interval will be computed from the timeout
4632N/A interval
4632N/A and number of UDP retries.
4632N/A </para>
4632N/A <para>
The <option>-r</option> option sets the number of UDP retries. The
default is
3. If zero, only one update request will be made.
</para>
<para>
The <option>-R <replaceable
class="parameter">randomdev</replaceable></option> option
specifies a source of randomness. If the operating system
does not provide a <filename>/dev/random</filename> or
equivalent device, the default source of randomness is keyboard
input. <filename>randomdev</filename> specifies the name of
a character device or file containing random data to be used
instead of the default. The special value
<filename>keyboard</filename> indicates that keyboard input
should be used. This option may be specified multiple times.
</para>
</refsect1>
<refsect1>
<title>INPUT FORMAT</title>
<para><command>nsupdate</command>
reads input from
<parameter>filename</parameter>
or standard input.
Each command is supplied on exactly one line of input.
Some commands are for administrative purposes.
The others are either update instructions or prerequisite checks on the
contents of the zone.
These checks set conditions that some name or set of
resource records (RRset) either exists or is absent from the zone.
These conditions must be met if the entire update request is to succeed.
Updates will be rejected if the tests for the prerequisite conditions
fail.
</para>
<para>
Every update request consists of zero or more prerequisites
and zero or more updates.
This allows a suitably authenticated update request to proceed if some
specified resource records are present or missing from the zone.
A blank input line (or the <command>send</command> command)
causes the
accumulated commands to be sent as one Dynamic DNS update request to the
name server.
</para>
<para>
The command formats and their meaning are as follows:
<variablelist>
<varlistentry>
<term>
<command>server</command>
<arg choice="req">servername</arg>
<arg choice="opt">port</arg>
</term>
<listitem>
<para>
Sends all dynamic update requests to the name server
<parameter>servername</parameter>.
When no server statement is provided,
<command>nsupdate</command>
will send updates to the master server of the correct zone.
The MNAME field of that zone's SOA record will identify the
master
server for that zone.
<parameter>port</parameter>
is the port number on
<parameter>servername</parameter>
where the dynamic update requests get sent.
If no port number is specified, the default DNS port number of
53 is
used.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<command>local</command>
<arg choice="req">address</arg>
<arg choice="opt">port</arg>
</term>
<listitem>
<para>
Sends all dynamic update requests using the local
<parameter>address</parameter>.
When no local statement is provided,
<command>nsupdate</command>
will send updates using an address and port chosen by the
system.
<parameter>port</parameter>
can additionally be used to make requests come from a specific
port.
If no port number is specified, the system will assign one.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<command>zone</command>
<arg choice="req">zonename</arg>
</term>
<listitem>
<para>
Specifies that all updates are to be made to the zone
<parameter>zonename</parameter>.
If no
<parameter>zone</parameter>
statement is provided,
<command>nsupdate</command>
will attempt determine the correct zone to update based on the
rest of the input.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<command>class</command>
<arg choice="req">classname</arg>
</term>
<listitem>
<para>
Specify the default class.
If no <parameter>class</parameter> is specified, the
default class is
<parameter>IN</parameter>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<command>ttl</command>
<arg choice="req">seconds</arg>
</term>
<listitem>
<para>
Specify the default time to live for records to be added.
The value <parameter>none</parameter> will clear the default
ttl.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<command>key</command>
<arg choice="req">name</arg>
<arg choice="req">secret</arg>
</term>
<listitem>
<para>
Specifies that all updates are to be TSIG-signed using the
<parameter>keyname</parameter> <parameter>keysecret</parameter> pair.
The <command>key</command> command
overrides any key specified on the command line via
<option>-y</option> or <option>-k</option>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<command>prereq nxdomain</command>
<arg choice="req">domain-name</arg>
</term>
<listitem>
<para>
Requires that no resource record of any type exists with name
<parameter>domain-name</parameter>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<command>prereq yxdomain</command>
<arg choice="req">domain-name</arg>
</term>
<listitem>
<para>
Requires that
<parameter>domain-name</parameter>
exists (has as at least one resource record, of any type).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<command>prereq nxrrset</command>
<arg choice="req">domain-name</arg>
<arg choice="opt">class</arg>
<arg choice="req">type</arg>
</term>
<listitem>
<para>
Requires that no resource record exists of the specified
<parameter>type</parameter>,
<parameter>class</parameter>
and
<parameter>domain-name</parameter>.
If
<parameter>class</parameter>
is omitted, IN (internet) is assumed.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<command>prereq yxrrset</command>
<arg choice="req">domain-name</arg>
<arg choice="opt">class</arg>
<arg choice="req">type</arg>
</term>
<listitem>
<para>
This requires that a resource record of the specified
<parameter>type</parameter>,
<parameter>class</parameter>
and
<parameter>domain-name</parameter>
must exist.
If
<parameter>class</parameter>
is omitted, IN (internet) is assumed.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<command>prereq yxrrset</command>
<arg choice="req">domain-name</arg>
<arg choice="opt">class</arg>
<arg choice="req">type</arg>
<arg choice="req" rep="repeat">data</arg>
</term>
<listitem>
<para>
The
<parameter>data</parameter>
from each set of prerequisites of this form
sharing a common
<parameter>type</parameter>,
<parameter>class</parameter>,
and
<parameter>domain-name</parameter>
are combined to form a set of RRs. This set of RRs must
exactly match the set of RRs existing in the zone at the
given
<parameter>type</parameter>,
<parameter>class</parameter>,
and
<parameter>domain-name</parameter>.
The
<parameter>data</parameter>
are written in the standard text representation of the resource
record's
RDATA.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<command>update delete</command>
<arg choice="req">domain-name</arg>
<arg choice="opt">ttl</arg>
<arg choice="opt">class</arg>
<arg choice="opt">type <arg choice="opt" rep="repeat">data</arg></arg>
</term>
<listitem>
<para>
Deletes any resource records named
<parameter>domain-name</parameter>.
If
<parameter>type</parameter>
and
<parameter>data</parameter>
is provided, only matching resource records will be removed.
The internet class is assumed if
<parameter>class</parameter>
is not supplied. The
<parameter>ttl</parameter>
is ignored, and is only allowed for compatibility.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<command>update add</command>
<arg choice="req">domain-name</arg>
<arg choice="req">ttl</arg>
<arg choice="opt">class</arg>
<arg choice="req">type</arg>
<arg choice="req" rep="repeat">data</arg>
</term>
<listitem>
<para>
Adds a new resource record with the specified
<parameter>ttl</parameter>,
<parameter>class</parameter>
and
<parameter>data</parameter>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<command>show</command>
</term>
<listitem>
<para>
Displays the current message, containing all of the
prerequisites and
updates specified since the last send.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<command>send</command>
</term>
<listitem>
<para>
Sends the current message. This is equivalent to entering a
blank line.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<command>answer</command>
</term>
<listitem>
<para>
Displays the answer.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<command>debug</command>
</term>
<listitem>
<para>
Turn on debugging.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<para>
Lines beginning with a semicolon are comments and are ignored.
</para>
</refsect1>
<refsect1>
<title>EXAMPLES</title>
<para>
The examples below show how
<command>nsupdate</command>
could be used to insert and delete resource records from the
<type>example.com</type>
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
<type>example.com</type>.
<programlisting>
# nsupdate
&gt; update delete oldhost.example.com A
&gt; update add newhost.example.com 86400 A 172.16.1.1
&gt; send
</programlisting>
</para>
<para>
Any A records for
<type>oldhost.example.com</type>
are deleted.
And an A record for
<type>newhost.example.com</type>
with IP address 172.16.1.1 is added.
The newly-added record has a 1 day TTL (86400 seconds).
<programlisting>
# nsupdate
&gt; prereq nxdomain nickname.example.com
&gt; update add nickname.example.com 86400 CNAME somehost.example.com
&gt; send
</programlisting>
</para>
<para>
The prerequisite condition gets the name server to check that there
are no resource records of any type for
<type>nickname.example.com</type>.
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.)
</para>
</refsect1>
<refsect1>
<title>FILES</title>
<variablelist>
<varlistentry>
<term><constant>/etc/resolv.conf</constant></term>
<listitem>
<para>
used to identify default name server
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>/var/run/named/ddns.key</constant></term>
<listitem>
<para>
sets the default TSIG key for use in local-only mode
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>K{name}.+157.+{random}.key</constant></term>
<listitem>
<para>
base-64 encoding of HMAC-MD5 key created by
<citerefentry>
<refentrytitle>dnssec-keygen</refentrytitle><manvolnum>8</manvolnum>
</citerefentry>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>K{name}.+157.+{random}.private</constant></term>
<listitem>
<para>
base-64 encoding of HMAC-MD5 key created by
<citerefentry>
<refentrytitle>dnssec-keygen</refentrytitle><manvolnum>8</manvolnum>
</citerefentry>.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>SEE ALSO</title>
<para><citerefentry>
<refentrytitle>RFC2136</refentrytitle>
</citerefentry>,
<citerefentry>
<refentrytitle>RFC3007</refentrytitle>
</citerefentry>,
<citerefentry>
<refentrytitle>RFC2104</refentrytitle>
</citerefentry>,
<citerefentry>
<refentrytitle>RFC2845</refentrytitle>
</citerefentry>,
<citerefentry>
<refentrytitle>RFC1034</refentrytitle>
</citerefentry>,
<citerefentry>
<refentrytitle>RFC2535</refentrytitle>
</citerefentry>,
<citerefentry>
<refentrytitle>RFC2931</refentrytitle>
</citerefentry>,
<citerefentry>
<refentrytitle>named</refentrytitle><manvolnum>8</manvolnum>
</citerefentry>,
<citerefentry>
<refentrytitle>ddns-confgen</refentrytitle><manvolnum>8</manvolnum>
</citerefentry>,
<citerefentry>
<refentrytitle>dnssec-keygen</refentrytitle><manvolnum>8</manvolnum>
</citerefentry>.
</para>
</refsect1>
<refsect1>
<title>BUGS</title>
<para>
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.
</para>
</refsect1>
</refentry><!--
- Local variables:
- mode: sgml
- End:
-->