]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - contrib/bind9/bin/nsupdate/nsupdate.1
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / contrib / bind9 / bin / nsupdate / nsupdate.1
1 .\" Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC")
2 .\" Copyright (C) 2000-2003 Internet Software Consortium.
3 .\" 
4 .\" Permission to use, copy, modify, and/or distribute this software for any
5 .\" purpose with or without fee is hereby granted, provided that the above
6 .\" copyright notice and this permission notice appear in all copies.
7 .\" 
8 .\" THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
9 .\" REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10 .\" AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
11 .\" INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12 .\" LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
13 .\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14 .\" PERFORMANCE OF THIS SOFTWARE.
15 .\"
16 .\" $Id$
17 .\"
18 .hy 0
19 .ad l
20 .\"     Title: nsupdate
21 .\"    Author: 
22 .\" Generator: DocBook XSL Stylesheets v1.71.1 <http://docbook.sf.net/>
23 .\"      Date: Aug 25, 2009
24 .\"    Manual: BIND9
25 .\"    Source: BIND9
26 .\"
27 .TH "NSUPDATE" "1" "Aug 25, 2009" "BIND9" "BIND9"
28 .\" disable hyphenation
29 .nh
30 .\" disable justification (adjust text to left margin only)
31 .ad l
32 .SH "NAME"
33 nsupdate \- Dynamic DNS update utility
34 .SH "SYNOPSIS"
35 .HP 9
36 \fBnsupdate\fR [\fB\-d\fR] [\fB\-D\fR] [[\fB\-g\fR] | [\fB\-o\fR] | [\fB\-l\fR] | [\fB\-y\ \fR\fB\fI[hmac:]\fR\fIkeyname:secret\fR\fR] | [\fB\-k\ \fR\fB\fIkeyfile\fR\fR]] [\fB\-t\ \fR\fB\fItimeout\fR\fR] [\fB\-u\ \fR\fB\fIudptimeout\fR\fR] [\fB\-r\ \fR\fB\fIudpretries\fR\fR] [\fB\-R\ \fR\fB\fIrandomdev\fR\fR] [\fB\-v\fR] [filename]
37 .SH "DESCRIPTION"
38 .PP
39 \fBnsupdate\fR
40 is used to submit Dynamic DNS Update requests as defined in RFC 2136 to a name server. This allows resource records to be added or removed from a zone without manually editing the zone file. A single update request can contain requests to add or remove more than one resource record.
41 .PP
42 Zones that are under dynamic control via
43 \fBnsupdate\fR
44 or a DHCP server should not be edited by hand. Manual edits could conflict with dynamic updates and cause data to be lost.
45 .PP
46 The resource records that are dynamically added or removed with
47 \fBnsupdate\fR
48 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.
49 .PP
50 The
51 \fB\-d\fR
52 option makes
53 \fBnsupdate\fR
54 operate in debug mode. This provides tracing information about the update requests that are made and the replies received from the name server.
55 .PP
56 The
57 \fB\-D\fR
58 option makes
59 \fBnsupdate\fR
60 report additional debugging information to
61 \fB\-d\fR.
62 .PP
63 The
64 \fB\-L\fR
65 option with an integer argument of zero or higher sets the logging debug level. If zero, logging is disabled.
66 .PP
67 Transaction signatures can be used to authenticate the Dynamic DNS updates. These use the TSIG resource record type described in RFC 2845 or the SIG(0) record described in RFC 2535 and RFC 2931 or GSS\-TSIG as described in RFC 3645. TSIG relies on a shared secret that should only be known to
68 \fBnsupdate\fR
69 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
70 \fBkey\fR
71 and
72 \fBserver\fR
73 statements would be added to
74 \fI/etc/named.conf\fR
75 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. SIG(0) uses public key cryptography. To use a SIG(0) key, the public key must be stored in a KEY record in a zone served by the name server.
76 \fBnsupdate\fR
77 does not read
78 \fI/etc/named.conf\fR.
79 .PP
80 GSS\-TSIG uses Kerberos credentials. Standard GSS\-TSIG mode is switched on with the
81 \fB\-g\fR
82 flag. A non\-standards\-compliant variant of GSS\-TSIG used by Windows 2000 can be switched on with the
83 \fB\-o\fR
84 flag.
85 .PP
86 \fBnsupdate\fR
87 uses the
88 \fB\-y\fR
89 or
90 \fB\-k\fR
91 option to provide the shared secret needed to generate a TSIG record for authenticating Dynamic DNS update requests, default type HMAC\-MD5. These options are mutually exclusive.
92 .PP
93 When the
94 \fB\-y\fR
95 option is used, a signature is generated from
96 [\fIhmac:\fR]\fIkeyname:secret.\fR
97 \fIkeyname\fR
98 is the name of the key, and
99 \fIsecret\fR
100 is the base64 encoded shared secret. Use of the
101 \fB\-y\fR
102 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
103 \fBps\fR(1)
104 or in a history file maintained by the user's shell.
105 .PP
106 With the
107 \fB\-k\fR
108 option,
109 \fBnsupdate\fR
110 reads the shared secret from the file
111 \fIkeyfile\fR. Keyfiles may be in two formats: a single file containing a
112 \fInamed.conf\fR\-format
113 \fBkey\fR
114 statement, which may be generated automatically by
115 \fBddns\-confgen\fR, or a pair of files whose names are of the format
116 \fIK{name}.+157.+{random}.key\fR
117 and
118 \fIK{name}.+157.+{random}.private\fR, which can be generated by
119 \fBdnssec\-keygen\fR. The
120 \fB\-k\fR
121 may also be used to specify a SIG(0) key used to authenticate Dynamic DNS update requests. In this case, the key specified is not an HMAC\-MD5 key.
122 .PP
123 \fBnsupdate\fR
124 can be run in a local\-host only mode using the
125 \fB\-l\fR
126 flag. This sets the server address to localhost (disabling the
127 \fBserver\fR
128 so that the server address cannot be overridden). Connections to the local server will use a TSIG key found in
129 \fI/var/run/named/session.key\fR, which is automatically generated by
130 \fBnamed\fR
131 if any local master zone has set
132 \fBupdate\-policy\fR
133 to
134 \fBlocal\fR. The location of this key file can be overridden with the
135 \fB\-k\fR
136 option.
137 .PP
138 By default,
139 \fBnsupdate\fR
140 uses UDP to send update requests to the name server unless they are too large to fit in a UDP request in which case TCP will be used. The
141 \fB\-v\fR
142 option makes
143 \fBnsupdate\fR
144 use a TCP connection. This may be preferable when a batch of update requests is made.
145 .PP
146 The
147 \fB\-p\fR
148 sets the default port number to use for connections to a name server. The default is 53.
149 .PP
150 The
151 \fB\-t\fR
152 option sets the maximum time an update request can take before it is aborted. The default is 300 seconds. Zero can be used to disable the timeout.
153 .PP
154 The
155 \fB\-u\fR
156 option sets the UDP retry interval. The default is 3 seconds. If zero, the interval will be computed from the timeout interval and number of UDP retries.
157 .PP
158 The
159 \fB\-r\fR
160 option sets the number of UDP retries. The default is 3. If zero, only one update request will be made.
161 .PP
162 The
163 \fB\-R \fR\fB\fIrandomdev\fR\fR
164 option specifies a source of randomness. If the operating system does not provide a
165 \fI/dev/random\fR
166 or equivalent device, the default source of randomness is keyboard input.
167 \fIrandomdev\fR
168 specifies the name of a character device or file containing random data to be used instead of the default. The special value
169 \fIkeyboard\fR
170 indicates that keyboard input should be used. This option may be specified multiple times.
171 .SH "INPUT FORMAT"
172 .PP
173 \fBnsupdate\fR
174 reads input from
175 \fIfilename\fR
176 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.
177 .PP
178 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
179 \fBsend\fR
180 command) causes the accumulated commands to be sent as one Dynamic DNS update request to the name server.
181 .PP
182 The command formats and their meaning are as follows:
183 .PP
184 \fBserver\fR {servername} [port]
185 .RS 4
186 Sends all dynamic update requests to the name server
187 \fIservername\fR. When no server statement is provided,
188 \fBnsupdate\fR
189 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.
190 \fIport\fR
191 is the port number on
192 \fIservername\fR
193 where the dynamic update requests get sent. If no port number is specified, the default DNS port number of 53 is used.
194 .RE
195 .PP
196 \fBlocal\fR {address} [port]
197 .RS 4
198 Sends all dynamic update requests using the local
199 \fIaddress\fR. When no local statement is provided,
200 \fBnsupdate\fR
201 will send updates using an address and port chosen by the system.
202 \fIport\fR
203 can additionally be used to make requests come from a specific port. If no port number is specified, the system will assign one.
204 .RE
205 .PP
206 \fBzone\fR {zonename}
207 .RS 4
208 Specifies that all updates are to be made to the zone
209 \fIzonename\fR. If no
210 \fIzone\fR
211 statement is provided,
212 \fBnsupdate\fR
213 will attempt determine the correct zone to update based on the rest of the input.
214 .RE
215 .PP
216 \fBclass\fR {classname}
217 .RS 4
218 Specify the default class. If no
219 \fIclass\fR
220 is specified, the default class is
221 \fIIN\fR.
222 .RE
223 .PP
224 \fBttl\fR {seconds}
225 .RS 4
226 Specify the default time to live for records to be added. The value
227 \fInone\fR
228 will clear the default ttl.
229 .RE
230 .PP
231 \fBkey\fR {name} {secret}
232 .RS 4
233 Specifies that all updates are to be TSIG\-signed using the
234 \fIkeyname\fR
235 \fIkeysecret\fR
236 pair. The
237 \fBkey\fR
238 command overrides any key specified on the command line via
239 \fB\-y\fR
240 or
241 \fB\-k\fR.
242 .RE
243 .PP
244 \fBgsstsig\fR
245 .RS 4
246 Use GSS\-TSIG to sign the updated. This is equivalent to specifying
247 \fB\-g\fR
248 on the commandline.
249 .RE
250 .PP
251 \fBoldgsstsig\fR
252 .RS 4
253 Use the Windows 2000 version of GSS\-TSIG to sign the updated. This is equivalent to specifying
254 \fB\-o\fR
255 on the commandline.
256 .RE
257 .PP
258 \fBrealm\fR {[realm_name]}
259 .RS 4
260 When using GSS\-TSIG use
261 \fIrealm_name\fR
262 rather than the default realm in
263 \fIkrb5.conf\fR. If no realm is specified the saved realm is cleared.
264 .RE
265 .PP
266 \fBprereq nxdomain\fR {domain\-name}
267 .RS 4
268 Requires that no resource record of any type exists with name
269 \fIdomain\-name\fR.
270 .RE
271 .PP
272 \fBprereq yxdomain\fR {domain\-name}
273 .RS 4
274 Requires that
275 \fIdomain\-name\fR
276 exists (has as at least one resource record, of any type).
277 .RE
278 .PP
279 \fBprereq nxrrset\fR {domain\-name} [class] {type}
280 .RS 4
281 Requires that no resource record exists of the specified
282 \fItype\fR,
283 \fIclass\fR
284 and
285 \fIdomain\-name\fR. If
286 \fIclass\fR
287 is omitted, IN (internet) is assumed.
288 .RE
289 .PP
290 \fBprereq yxrrset\fR {domain\-name} [class] {type}
291 .RS 4
292 This requires that a resource record of the specified
293 \fItype\fR,
294 \fIclass\fR
295 and
296 \fIdomain\-name\fR
297 must exist. If
298 \fIclass\fR
299 is omitted, IN (internet) is assumed.
300 .RE
301 .PP
302 \fBprereq yxrrset\fR {domain\-name} [class] {type} {data...}
303 .RS 4
304 The
305 \fIdata\fR
306 from each set of prerequisites of this form sharing a common
307 \fItype\fR,
308 \fIclass\fR, and
309 \fIdomain\-name\fR
310 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
311 \fItype\fR,
312 \fIclass\fR, and
313 \fIdomain\-name\fR. The
314 \fIdata\fR
315 are written in the standard text representation of the resource record's RDATA.
316 .RE
317 .PP
318 \fBupdate delete\fR {domain\-name} [ttl] [class] [type\ [data...]]
319 .RS 4
320 Deletes any resource records named
321 \fIdomain\-name\fR. If
322 \fItype\fR
323 and
324 \fIdata\fR
325 is provided, only matching resource records will be removed. The internet class is assumed if
326 \fIclass\fR
327 is not supplied. The
328 \fIttl\fR
329 is ignored, and is only allowed for compatibility.
330 .RE
331 .PP
332 \fBupdate add\fR {domain\-name} {ttl} [class] {type} {data...}
333 .RS 4
334 Adds a new resource record with the specified
335 \fIttl\fR,
336 \fIclass\fR
337 and
338 \fIdata\fR.
339 .RE
340 .PP
341 \fBshow\fR
342 .RS 4
343 Displays the current message, containing all of the prerequisites and updates specified since the last send.
344 .RE
345 .PP
346 \fBsend\fR
347 .RS 4
348 Sends the current message. This is equivalent to entering a blank line.
349 .RE
350 .PP
351 \fBanswer\fR
352 .RS 4
353 Displays the answer.
354 .RE
355 .PP
356 \fBdebug\fR
357 .RS 4
358 Turn on debugging.
359 .RE
360 .PP
361 Lines beginning with a semicolon are comments and are ignored.
362 .SH "EXAMPLES"
363 .PP
364 The examples below show how
365 \fBnsupdate\fR
366 could be used to insert and delete resource records from the
367 \fBexample.com\fR
368 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
369 \fBexample.com\fR.
370 .sp
371 .RS 4
372 .nf
373 # nsupdate
374 > update delete oldhost.example.com A
375 > update add newhost.example.com 86400 A 172.16.1.1
376 > send
377 .fi
378 .RE
379 .sp
380 .PP
381 Any A records for
382 \fBoldhost.example.com\fR
383 are deleted. And an A record for
384 \fBnewhost.example.com\fR
385 with IP address 172.16.1.1 is added. The newly\-added record has a 1 day TTL (86400 seconds).
386 .sp
387 .RS 4
388 .nf
389 # nsupdate
390 > prereq nxdomain nickname.example.com
391 > update add nickname.example.com 86400 CNAME somehost.example.com
392 > send
393 .fi
394 .RE
395 .sp
396 .PP
397 The prerequisite condition gets the name server to check that there are no resource records of any type for
398 \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 RFC 1034 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 RFC 2535 to allow CNAMEs to have RRSIG, DNSKEY and NSEC records.)
399 .SH "FILES"
400 .PP
401 \fB/etc/resolv.conf\fR
402 .RS 4
403 used to identify default name server
404 .RE
405 .PP
406 \fB/var/run/named/session.key\fR
407 .RS 4
408 sets the default TSIG key for use in local\-only mode
409 .RE
410 .PP
411 \fBK{name}.+157.+{random}.key\fR
412 .RS 4
413 base\-64 encoding of HMAC\-MD5 key created by
414 \fBdnssec\-keygen\fR(8).
415 .RE
416 .PP
417 \fBK{name}.+157.+{random}.private\fR
418 .RS 4
419 base\-64 encoding of HMAC\-MD5 key created by
420 \fBdnssec\-keygen\fR(8).
421 .RE
422 .SH "SEE ALSO"
423 .PP
424 RFC 2136,
425 RFC 3007,
426 RFC 2104,
427 RFC 2845,
428 RFC 1034,
429 RFC 2535,
430 RFC 2931,
431 \fBnamed\fR(8),
432 \fBddns\-confgen\fR(8),
433 \fBdnssec\-keygen\fR(8).
434 .SH "BUGS"
435 .PP
436 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.
437 .SH "COPYRIGHT"
438 Copyright \(co 2004\-2010 Internet Systems Consortium, Inc. ("ISC")
439 .br
440 Copyright \(co 2000\-2003 Internet Software Consortium.
441 .br