bind9/bin/nsupdate/nsupdate.8

342 lines
9.8 KiB
Groff
Raw Normal View History

2001-07-17 15:48:57 -04:00
.\"
2001-01-09 17:01:04 -05:00
.\" Copyright (C) 2000, 2001 Internet Software Consortium.
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
.\" DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
.\" INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
.\" INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
.\" FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
.\" NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
.\" WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2001-07-17 15:48:57 -04:00
.\"
2001-03-30 21:23:18 -05:00
.TH "NSUPDATE" "8" "Jun 30, 2000" "BIND9" ""
.SH NAME
nsupdate \- Dynamic DNS update utility
.SH SYNOPSIS
.sp
\fBnsupdate\fR [ \fB-d\fR ] [ \fB [ -y \fIkeyname:secret\fB ] [ -k \fIkeyfile\fB ] \fR ] [ \fB-v\fR ] [ \fBfilename\fR ]
.SH "DESCRIPTION"
.PP
\fBnsupdate\fR
is used to submit Dynamic DNS Update requests as defined in RFC2136
to a name server.
This allows resource records to be added or removed from a zone
without manually editing the zone file.
2000-08-15 15:40:40 -04:00
A single update request can contain requests to add or remove more than one
resource record.
2001-03-30 21:23:18 -05:00
.PP
Zones that are under dynamic control via
2001-03-30 21:23:18 -05:00
\fBnsupdate\fR
or a DHCP server should not be edited by hand.
Manual edits could
2000-08-15 16:15:49 -04:00
conflict with dynamic updates and cause data to be lost.
2001-03-30 21:23:18 -05:00
.PP
2000-08-15 15:40:40 -04:00
The resource records that are dynamically added or removed with
2001-03-30 21:23:18 -05:00
\fBnsupdate\fR
have to be in the same zone.
Requests are sent to the zone's master server.
This is identified by the MNAME field of the zone's SOA record.
2001-03-30 21:23:18 -05:00
.PP
The
2001-03-30 21:23:18 -05:00
\fB-d\fR
option makes
2001-03-30 21:23:18 -05:00
\fBnsupdate\fR
operate in debug mode.
This provides tracing information about the update requests that are
made and the replies received from the name server.
2001-03-30 21:23:18 -05:00
.PP
Transaction signatures can be used to authenticate the Dynamic DNS
updates.
These use the TSIG resource record type described in RFC2845.
The signatures rely on a shared secret that should only be known to
2001-03-30 21:23:18 -05:00
\fBnsupdate\fR
and the name server.
Currently, the only supported encryption algorithm for TSIG is
HMAC-MD5, which is defined in RFC 2104.
Once other algorithms are defined for TSIG, applications will need to
ensure they select the appropriate algorithm as well as the key when
authenticating each other.
For instance suitable
2001-03-30 21:23:18 -05:00
\fBkey\fR
and
2001-03-30 21:23:18 -05:00
\fBserver\fR
statements would be added to
2001-03-30 21:23:18 -05:00
\fI/etc/named.conf\fR
so that the name server can associate the appropriate secret key
and algorithm with the IP address of the
client application that will be using TSIG authentication.
2001-03-30 21:23:18 -05:00
\fBnsupdate\fR
does not read
2001-03-30 21:23:18 -05:00
\fI/etc/named.conf\fR.
.PP
\fBnsupdate\fR
uses the
2001-03-30 21:23:18 -05:00
\fB-y\fR
2000-08-15 15:40:40 -04:00
or
2001-03-30 21:23:18 -05:00
\fB-k\fR
2000-08-15 15:40:40 -04:00
option to provide the shared secret needed to generate a TSIG record
for authenticating Dynamic DNS update requests.
These options are mutually exclusive.
2000-08-15 15:40:40 -04:00
With the
2001-03-30 21:23:18 -05:00
\fB-k\fR
2000-08-15 15:40:40 -04:00
option,
2001-03-30 21:23:18 -05:00
\fBnsupdate\fR
2000-08-15 15:40:40 -04:00
reads the shared secret from the file
2001-03-30 21:23:18 -05:00
\fIkeyfile\fR,
2000-08-15 16:15:49 -04:00
whose name is of the form
2001-03-30 21:23:18 -05:00
\fIK{name}.+157.+{random}.private\fR.
2000-08-15 16:15:49 -04:00
For historical
reasons, the file
2001-03-30 21:23:18 -05:00
\fIK{name}.+157.+{random}.key\fR
must also be present. When the
\fB-y\fR
2000-08-15 16:15:49 -04:00
option is used, a signature is generated from
2001-03-30 21:23:18 -05:00
\fIkeyname:secret.\fR
\fIkeyname\fR
is the name of the key,
and
2001-03-30 21:23:18 -05:00
\fIsecret\fR
2000-08-15 15:40:40 -04:00
is the base64 encoded shared secret.
Use of the
2001-03-30 21:23:18 -05:00
\fB-y\fR
option is discouraged because the shared secret is supplied as a command
line argument in clear text.
This may be visible in the output from
2001-03-30 21:23:18 -05:00
\fBps\fR(1)
or in a history file maintained by the user's shell.
2001-03-30 21:23:18 -05:00
.PP
By default
2001-03-30 21:23:18 -05:00
\fBnsupdate\fR
uses UDP to send update requests to the name server.
The
2001-03-30 21:23:18 -05:00
\fB-v\fR
option makes
2001-03-30 21:23:18 -05:00
\fBnsupdate\fR
use a TCP connection.
2000-08-15 15:40:40 -04:00
This may be preferable when a batch of update requests is made.
2001-03-30 21:23:18 -05:00
.SH "INPUT FORMAT"
.PP
\fBnsupdate\fR
reads input from
2001-03-30 21:23:18 -05:00
\fIfilename\fR
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.
2001-03-30 21:23:18 -05:00
.PP
Every update request consists of zero or more prerequisites
2000-08-15 15:40:40 -04:00
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.
2001-07-14 14:30:02 -04:00
A blank input line (or the \fBsend\fR command) causes the
2001-07-14 14:29:10 -04:00
accumulated commands to be sent as one Dynamic DNS update request to the
name server.
2001-03-30 21:23:18 -05:00
.PP
The command formats and their meaning are as follows:
2001-03-30 21:23:18 -05:00
.TP
\fBserver servername [ port ]\fR
Sends all dynamic update requests to the name server
2001-03-30 21:23:18 -05:00
\fIservername\fR.
When no server statement is provided,
2001-03-30 21:23:18 -05:00
\fBnsupdate\fR
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.
2001-03-30 21:23:18 -05:00
\fIport\fR
is the port number on
2001-03-30 21:23:18 -05:00
\fIservername\fR
where the dynamic update requests get sent.
If no port number is specified, the default DNS port number of 53 is
used.
2001-03-30 21:23:18 -05:00
.TP
\fBlocal address [ port ]\fR
2000-11-16 00:59:11 -05:00
Sends all dynamic update requests using the local
2001-03-30 21:23:18 -05:00
\fIaddress\fR.
2000-11-16 00:59:11 -05:00
When no local statement is provided,
2001-03-30 21:23:18 -05:00
\fBnsupdate\fR
2003-07-22 22:23:06 -04:00
will send updates using an address and port chosen by the system.
2001-03-30 21:23:18 -05:00
\fIport\fR
2000-11-16 00:59:11 -05:00
can additionally be used to make requests come from a specific port.
If no port number is specified, the system will assign one.
2001-03-30 21:23:18 -05:00
.TP
\fBzone zonename\fR
Specifies that all updates are to be made to the zone
2001-03-30 21:23:18 -05:00
\fIzonename\fR.
2000-08-15 15:40:40 -04:00
If no
2001-03-30 21:23:18 -05:00
\fIzone\fR
2000-08-15 15:40:40 -04:00
statement is provided,
2001-03-30 21:23:18 -05:00
\fBnsupdate\fR
2000-08-15 15:40:40 -04:00
will attempt determine the correct zone to update based on the rest of the input.
2001-03-30 21:23:18 -05:00
.TP
\fBkey name secret\fR
Specifies that all updates are to be TSIG signed using the
\fIkeyname\fR \fIkeysecret\fR pair.
The \fBkey\fR command
overrides any key specified on the command line via
\fB-y\fR or \fB-k\fR.
.TP
\fBprereq nxdomain domain-name\fR
Requires that no resource record of any type exists with name
2001-03-30 21:23:18 -05:00
\fIdomain-name\fR.
.TP
\fBprereq yxdomain domain-name\fR
Requires that
2001-03-30 21:23:18 -05:00
\fIdomain-name\fR
2000-08-15 15:40:40 -04:00
exists (has as at least one resource record, of any type).
2001-03-30 21:23:18 -05:00
.TP
\fBprereq nxrrset domain-name [ class ] type\fR
Requires that no resource record exists of the specified
2001-03-30 21:23:18 -05:00
\fItype\fR,
\fIclass\fR
and
2001-03-30 21:23:18 -05:00
\fIdomain-name\fR.
If
2001-03-30 21:23:18 -05:00
\fIclass\fR
is omitted, IN (internet) is assumed.
2001-03-30 21:23:18 -05:00
.TP
\fBprereq yxrrset domain-name [ class ] type\fR
2000-08-15 15:40:40 -04:00
This requires that a resource record of the specified
2001-03-30 21:23:18 -05:00
\fItype\fR,
\fIclass\fR
2000-08-15 15:40:40 -04:00
and
2001-03-30 21:23:18 -05:00
\fIdomain-name\fR
must exist.
If
2001-03-30 21:23:18 -05:00
\fIclass\fR
is omitted, IN (internet) is assumed.
2001-03-30 21:23:18 -05:00
.TP
\fBprereq yxrrset domain-name [ class ] type data\fI...\fB\fR
2000-08-15 15:40:40 -04:00
The
2001-03-30 21:23:18 -05:00
\fIdata\fR
2000-08-15 15:40:40 -04:00
from each set of prerequisites of this form
sharing a common
2001-03-30 21:23:18 -05:00
\fItype\fR,
\fIclass\fR,
2000-08-15 15:40:40 -04:00
and
2001-03-30 21:23:18 -05:00
\fIdomain-name\fR
are combined to form a set of RRs. This set of RRs must
2000-08-15 15:40:40 -04:00
exactly match the set of RRs existing in the zone at the
given
2001-03-30 21:23:18 -05:00
\fItype\fR,
\fIclass\fR,
2000-08-15 15:40:40 -04:00
and
2001-03-30 21:23:18 -05:00
\fIdomain-name\fR.
2000-08-15 15:40:40 -04:00
The
2001-03-30 21:23:18 -05:00
\fIdata\fR
2000-08-15 15:40:40 -04:00
are written in the standard text representation of the resource record's
RDATA.
2001-03-30 21:23:18 -05:00
.TP
\fBupdate delete domain-name [ ttl ] [ class ] [ type [ data\fI...\fB ] ]\fR
Deletes any resource records named
2001-03-30 21:23:18 -05:00
\fIdomain-name\fR.
If
2001-03-30 21:23:18 -05:00
\fItype\fR
and
2001-03-30 21:23:18 -05:00
\fIdata\fR
is provided, only matching resource records will be removed.
The internet class is assumed if
2001-03-30 21:23:18 -05:00
\fIclass\fR
2001-03-30 21:39:52 -05:00
is not supplied. The
\fIttl\fR
is ignored, and is only allowed for compatibility.
2001-03-30 21:23:18 -05:00
.TP
\fBupdate add domain-name ttl [ class ] type data\fI...\fB\fR
Adds a new resource record with the specified
2001-03-30 21:23:18 -05:00
\fIttl\fR,
\fIclass\fR
and
2001-03-30 21:23:18 -05:00
\fIdata\fR.
2001-07-14 14:29:10 -04:00
.TP
\fBshow\fR
Displays the current message, containing all of the prerequisites and
updates specified since the last send.
.TP
\fBsend\fR
Sends the current message. This is equivalent to entering a blank line.
2001-03-30 21:39:52 -05:00
.PP
Lines beginning with a semicolon are comments, and are ignored.
2001-03-30 21:23:18 -05:00
.SH "EXAMPLES"
.PP
The examples below show how
2001-03-30 21:23:18 -05:00
\fBnsupdate\fR
could be used to insert and delete resource records from the
2001-03-30 21:23:18 -05:00
\fBexample.com\fR
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
2001-03-30 21:23:18 -05:00
\fBexample.com\fR.
.sp
.nf
# nsupdate
> update delete oldhost.example.com A
> update add newhost.example.com 86400 A 172.16.1.1
>
2001-03-30 21:23:18 -05:00
.sp
.fi
.PP
Any A records for
2001-03-30 21:23:18 -05:00
\fBoldhost.example.com\fR
are deleted.
and an A record for
2001-03-30 21:23:18 -05:00
\fBnewhost.example.com\fR
it IP address 172.16.1.1 is added.
The newly-added record has a 1 day TTL (86400 seconds)
2001-03-30 21:23:18 -05:00
.sp
.nf
# nsupdate
> prereq nxdomain nickname.example.com
2001-11-27 13:58:03 -05:00
> update add nickname.example.com 86400 CNAME somehost.example.com
>
2001-03-30 21:23:18 -05:00
.sp
.fi
.PP
The prerequisite condition gets the name server to check that there
are no resource records of any type for
2001-03-30 21:23:18 -05:00
\fBnickname.example.com\fR.
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
SIG, KEY and NXT records.)
2001-03-30 21:23:18 -05:00
.SH "FILES"
.TP
\fB/etc/resolv.conf\fR
2000-08-15 15:40:40 -04:00
used to identify default name server
2001-03-30 21:23:18 -05:00
.TP
\fBK{name}.+157.+{random}.key\fR
base-64 encoding of HMAC-MD5 key created by
2001-03-30 21:23:18 -05:00
\fBdnssec-keygen\fR(8).
.TP
\fBK{name}.+157.+{random}.private\fR
base-64 encoding of HMAC-MD5 key created by
2001-03-30 21:23:18 -05:00
\fBdnssec-keygen\fR(8).
.SH "SEE ALSO"
.PP
\fBRFC2136\fR,
\fBRFC3007\fR,
2001-03-30 21:23:18 -05:00
\fBRFC2104\fR,
\fBRFC2845\fR,
\fBRFC1034\fR,
\fBRFC2535\fR,
\fBnamed\fR(8),
\fBdnssec-keygen\fR(8).
.SH "BUGS"
.PP
2000-08-15 15:40:40 -04:00
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.