nsupdate.8 8.99 KB
Newer Older
1
.\" Copyright (C) 2000  Internet Software Consortium.
2
.\"
3 4 5
.\" 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.
6
.\"
7 8 9 10 11 12 13 14
.\" 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.
15
.\"
16
.\" $Id: nsupdate.8,v 1.6 2000/08/15 19:47:06 bwelling Exp $
17
.\"
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
.Dd Jun 30, 2000
.Dt NSUPDATE 8
.Os BIND9 9
.ds vT BIND9 Programmer's Manual
.Sh NAME
.Nm nsupdate
.Nd Dynamic DNS update utility
.Sh SYNOPSIS
.Nm nsupdate
.Op Fl d
.Oo
.Fl y Ar keyname:secret |
.Fl k Ar keyfile
.Oc
.Op Fl v
.Sh DESCRIPTION
.Nm nsupdate
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.
Andreas Gustafsson's avatar
Andreas Gustafsson committed
39
A single update request can contain requests to add or remove more than one
40 41 42 43 44 45
resource record.
.Pp
Zones that are under dynamic control via
.Nm nsupdate
or a DHCP server should not be edited by hand.
Manual edits could
Andreas Gustafsson's avatar
Andreas Gustafsson committed
46 47
conflict with dynamic updates and leave the name server's transaction
log out of sync witih the zone file, causing data to be lost.
48
.Pp
Andreas Gustafsson's avatar
Andreas Gustafsson committed
49
The resource records that are dynamically added or removed with
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
.Nm nsupdate
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.
.Pp
The
.Fl d
option makes
.Nm nsupdate
operate in debug mode.
This provides tracing information about the update requests that are
made and the replies received from the name server.
.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
.Nm nsupdate
and the name server.
69
Currently, the only supported encryption algorithm for TSIG is
70 71 72 73
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.
74
For instance suitable
75 76 77
.Dv key{}
and
.Dv server{}
78
statements would be added to
79
.Pa /etc/named.conf
80 81
so that the name server can associate the appropriate secret key
and algorithm with the IP address of the
82
client application that will be using TSIG authentication.
83 84 85
.Nm nsupdate
does not read
.Pa /etc/named.conf .
86 87 88 89
.Pp
.Nm nsupdate
uses the
.Fl y
Andreas Gustafsson's avatar
Andreas Gustafsson committed
90
or
91
.Fl k
Andreas Gustafsson's avatar
Andreas Gustafsson committed
92
option to provide the shared secret needed to generate a TSIG record
93 94
for authenticating Dynamic DNS update requests.
These options are mutually exclusive.
Andreas Gustafsson's avatar
Andreas Gustafsson committed
95
With the
96
.Fl k
Andreas Gustafsson's avatar
Andreas Gustafsson committed
97
option,
98
.Nm nsupdate
Andreas Gustafsson's avatar
Andreas Gustafsson committed
99
reads the shared secret from the file
100 101 102
.Ar keyfile ,
whose name is of the form K{name}.+157.+{random}.private .  For historical
reasons, the file K{name}.+157.+{random}.key must also be present.  When the
103 104 105 106 107 108 109
.Fl y
is used, a signature is generated from
.Ar keyname:secret.
.Ar keyname
is the name of the key,
and
.Ar secret
Andreas Gustafsson's avatar
Andreas Gustafsson committed
110
is the base64 encoded shared secret.
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
Use of the
.Fl y
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
.Xr ps 1
or in a history file maintained by the user's shell.
.Pp
By default
.Nm nsupdate
uses UDP to send update requests to the name server.
The
.Fl v
option makes
.Nm nsupdate
use a TCP connection.
Andreas Gustafsson's avatar
Andreas Gustafsson committed
127
This may be preferable when a batch of update requests is made.
128 129 130 131
.Sh INPUT FORMAT
.Nm nsupdate
reads commands from its standard input.
Each command is supplied on exactly one line of input.
132 133
Some commands are for administrative purposes.
The others are either update instructions or prerequisite checks on the
134 135 136 137 138
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.
139
.Pp
140
Every update request consists of zero or more prerequisites
Andreas Gustafsson's avatar
Andreas Gustafsson committed
141
and zero or more updates.
142
This allows a suitably authenticated update request to proceed if some
143
specified resource records are present or missing from the zone.
144 145 146 147 148 149
A blank input line causes the accumulated commands to be sent as one Dynamic
DNS update request to the name server.
.Pp
The command formats and their meaning are as follows:
.Bl -ohang indent
.It Xo
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
.Ic server Va servername Op port
.Xc
.sp 1
Sends all dynamic update requests to the name server
.Va servername .
When no server statement is provided,
.Nm nsupdate
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.
.Va port
is the port number on
.Va servername
where the dynamic update requests get sent.
If no port number is specified, the default DNS port number of 53 is
used.
.It Xo
.Ic zone Va zonename
.Xc
.sp 1
Specifies that all updates are to be made to the zone
.Va zonename .
Andreas Gustafsson's avatar
Andreas Gustafsson committed
172
If no
173
.Va zone
Andreas Gustafsson's avatar
Andreas Gustafsson committed
174 175 176
statement is provided,
.Nm nsupdate
will attempt determine the correct zone to update based on the rest of the input.
177
.It Xo
178 179 180 181 182 183 184 185 186 187 188
.Ic prereq nxdomain Va domain-name
.Xc
.sp 1
Requires that no resource record of any type exists with name
.Va domain-name .
.It Xo
.Ic prereq yxdomain Va domain-name
.Xc
.sp 1
Requires that
.Va domain-name
Andreas Gustafsson's avatar
Andreas Gustafsson committed
189
exists (has as at least one resource record, of any type).
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205
.It Xo
.Ic prereq nxrrset Va domain-name Op class
.Va type
.Xc
.sp 1
Requires that no resource record exists of the specified
.Va type ,
.Va class
and
.Va domain-name .
If
.Va class
is omitted, IN (internet) is assumed.
.It Xo
.Ic prereq yxrrset
.Va domain-name Op class
Andreas Gustafsson's avatar
Andreas Gustafsson committed
206
.Va type
207 208
.Xc
.sp 1
Andreas Gustafsson's avatar
Andreas Gustafsson committed
209
This requires that a resource record of the specified
210 211
.Va type ,
.Va class
Andreas Gustafsson's avatar
Andreas Gustafsson committed
212
and
213 214 215 216 217
.Va domain-name
must exist.
If
.Va class
is omitted, IN (internet) is assumed.
Andreas Gustafsson's avatar
Andreas Gustafsson committed
218 219 220 221 222 223 224
.It Xo
.Ic prereq yxrrset
.Va domain-name Op class
.Va type data...
.Xc
.sp 1
The
225
.Va data
Andreas Gustafsson's avatar
Andreas Gustafsson committed
226 227 228 229 230 231 232 233 234 235 236 237 238 239
from each set of prerequisites of this form
sharing a common
.Va type ,
.Va class ,
and 
.Va domain-name
is 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 
.Va type ,
.Va class ,
and 
.Va domain-name .
The
240
.Va data
Andreas Gustafsson's avatar
Andreas Gustafsson committed
241
are written in the standard text representation of the resource record's
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278
RDATA.
.It Xo
.Ic update delete
.Va domain-name Op class
.Va Op type Op data...
.Xc
.sp 1
Deletes any resource records named
.Va domain-name .
If
.Va type
and
.Va data
is provided, only matching resource records will be removed.
The internet class is assumed if
.Va class
is not supplied.
.It Xo
.Ic update add
.Va domain-name ttl Op class
.Va type data..
.Xc
.sp 1
Adds a new resource record with the specified
.Va ttl ,
.Va class
and
.Va data .
.El
.Sh EXAMPLES
The examples below show how
.Nm nsupdate
could be used to insert and delete resource records from the
.Dv example.com
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
279
master name server for
280 281 282 283 284 285 286 287 288 289 290 291
.Dv example.com .
.Bd -literal -offset indent
# nsupdate
> update delete oldhost.example.com A
> update add newhost.example.com 86400 A 172.16.1.1
>
.Ed
.Pp
Any A records for
.Dv oldhost.example.com
are deleted.
and an A record for
292
.Dv newhost.example.com
293 294
it IP address 172.16.1.1 is added.
The newly-added record has a 1 day TTL (86400 seconds)
295
.Bd -literal -offset indent
296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311
# nsupdate
> prereq nxdomain nickname.example.com
> update add nickname.example.com CNAME somehost.example.com
>
.Ed
.Pp
The prerequisite condition gets the name server to check that there
are no resource records of any type for
.Dv nickname.example.com .
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.)
312
.Pp
313
.Sh FILES
314
.Bl -tag -width K{name}.+157.+{random}.private -compact
Andreas Gustafsson's avatar
Andreas Gustafsson committed
315 316
.It Pa /etc/resolv.conf
used to identify default name server
317
.It Pa K{name}.+157.+{random}.key
318 319
base-64 encoding of HMAC-MD5 key created by
.Xr dnssec-keygen 8 .
320
.It Pa K{name}.+157.+{random}.private
321 322 323 324 325 326 327 328 329 330 331 332
base-64 encoding of HMAC-MD5 key created by
.Xr dnssec-keygen 8 .
.El
.Sh SEE ALSO
.Xr RFC2136 ,
.Xr RFC2137 ,
.Xr RFC2104 ,
.Xr RFC2845 ,
.Xr RFC1034 ,
.Xr RFC2535 ,
.Xr named 8 ,
.Xr dnssec-keygen 8 .
333
.Sh BUGS
Andreas Gustafsson's avatar
Andreas Gustafsson committed
334 335 336 337
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.