]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/blob - contrib/bind9/bin/nsupdate/nsupdate.1
MFV r306384:
[FreeBSD/stable/9.git] / contrib / bind9 / bin / nsupdate / nsupdate.1
1 .\" Copyright (C) 2004-2012, 2014, 2015 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 .hy 0
17 .ad l
18 '\" t
19 .\"     Title: nsupdate
20 .\"    Author: 
21 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
22 .\"      Date: 2014-04-18
23 .\"    Manual: BIND9
24 .\"    Source: ISC
25 .\"  Language: English
26 .\"
27 .TH "NSUPDATE" "1" "2014\-04\-18" "ISC" "BIND9"
28 .\" -----------------------------------------------------------------
29 .\" * Define some portability stuff
30 .\" -----------------------------------------------------------------
31 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32 .\" http://bugs.debian.org/507673
33 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
34 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
35 .ie \n(.g .ds Aq \(aq
36 .el       .ds Aq '
37 .\" -----------------------------------------------------------------
38 .\" * set default formatting
39 .\" -----------------------------------------------------------------
40 .\" disable hyphenation
41 .nh
42 .\" disable justification (adjust text to left margin only)
43 .ad l
44 .\" -----------------------------------------------------------------
45 .\" * MAIN CONTENT STARTS HERE *
46 .\" -----------------------------------------------------------------
47 .SH "NAME"
48 nsupdate \- Dynamic DNS update utility
49 .SH "SYNOPSIS"
50 .HP \w'\fBnsupdate\fR\ 'u
51 \fBnsupdate\fR [\fB\-d\fR] [\fB\-D\fR] [\fB\-L\ \fR\fB\fIlevel\fR\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] [\fB\-V\fR] [filename]
52 .SH "DESCRIPTION"
53 .PP
54 \fBnsupdate\fR
55 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\&.
56 .PP
57 Zones that are under dynamic control via
58 \fBnsupdate\fR
59 or a DHCP server should not be edited by hand\&. Manual edits could conflict with dynamic updates and cause data to be lost\&.
60 .PP
61 The resource records that are dynamically added or removed with
62 \fBnsupdate\fR
63 have to be in the same zone\&. Requests are sent to the zone\*(Aqs master server\&. This is identified by the MNAME field of the zone\*(Aqs SOA record\&.
64 .PP
65 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\&.
66 .PP
67 TSIG relies on a shared secret that should only be known to
68 \fBnsupdate\fR
69 and the name server\&. For instance, suitable
70 \fBkey\fR
71 and
72 \fBserver\fR
73 statements would be added to
74 /etc/named\&.conf
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\&. You can use
76 \fBddns\-confgen\fR
77 to generate suitable configuration fragments\&.
78 \fBnsupdate\fR
79 uses the
80 \fB\-y\fR
81 or
82 \fB\-k\fR
83 options to provide the TSIG shared secret\&. These options are mutually exclusive\&.
84 .PP
85 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\&.
86 .PP
87 GSS\-TSIG uses Kerberos credentials\&. Standard GSS\-TSIG mode is switched on with the
88 \fB\-g\fR
89 flag\&. A non\-standards\-compliant variant of GSS\-TSIG used by Windows 2000 can be switched on with the
90 \fB\-o\fR
91 flag\&.
92 .SH "OPTIONS"
93 .PP
94 \-d
95 .RS 4
96 Debug mode\&. This provides tracing information about the update requests that are made and the replies received from the name server\&.
97 .RE
98 .PP
99 \-D
100 .RS 4
101 Extra debug mode\&.
102 .RE
103 .PP
104 \-k \fIkeyfile\fR
105 .RS 4
106 The file containing the TSIG authentication key\&. Keyfiles may be in two formats: a single file containing a
107 named\&.conf\-format
108 \fBkey\fR
109 statement, which may be generated automatically by
110 \fBddns\-confgen\fR, or a pair of files whose names are of the format
111 K{name}\&.+157\&.+{random}\&.key
112 and
113 K{name}\&.+157\&.+{random}\&.private, which can be generated by
114 \fBdnssec\-keygen\fR\&. The
115 \fB\-k\fR
116 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\&.
117 .RE
118 .PP
119 \-l
120 .RS 4
121 Local\-host only mode\&. This sets the server address to localhost (disabling the
122 \fBserver\fR
123 so that the server address cannot be overridden)\&. Connections to the local server will use a TSIG key found in
124 /var/run/named/session\&.key, which is automatically generated by
125 \fBnamed\fR
126 if any local master zone has set
127 \fBupdate\-policy\fR
128 to
129 \fBlocal\fR\&. The location of this key file can be overridden with the
130 \fB\-k\fR
131 option\&.
132 .RE
133 .PP
134 \-L \fIlevel\fR
135 .RS 4
136 Set the logging debug level\&. If zero, logging is disabled\&.
137 .RE
138 .PP
139 \-p \fIport\fR
140 .RS 4
141 Set the port to use for connections to a name server\&. The default is 53\&.
142 .RE
143 .PP
144 \-r \fIudpretries\fR
145 .RS 4
146 The number of UDP retries\&. The default is 3\&. If zero, only one update request will be made\&.
147 .RE
148 .PP
149 \-R \fIrandomdev\fR
150 .RS 4
151 Where to obtain randomness\&. If the operating system does not provide a
152 /dev/random
153 or equivalent device, the default source of randomness is keyboard input\&.
154 randomdev
155 specifies the name of a character device or file containing random data to be used instead of the default\&. The special value
156 keyboard
157 indicates that keyboard input should be used\&. This option may be specified multiple times\&.
158 .RE
159 .PP
160 \-t \fItimeout\fR
161 .RS 4
162 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\&.
163 .RE
164 .PP
165 \-u \fIudptimeout\fR
166 .RS 4
167 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\&.
168 .RE
169 .PP
170 \-v
171 .RS 4
172 Use TCP even for small update requests\&. By default,
173 \fBnsupdate\fR
174 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\&. TCP may be preferable when a batch of update requests is made\&.
175 .RE
176 .PP
177 \-V
178 .RS 4
179 Print the version number and exit\&.
180 .RE
181 .PP
182 \-y \fI[hmac:]\fR\fIkeyname:secret\fR
183 .RS 4
184 Literal TSIG authentication key\&.
185 \fIkeyname\fR
186 is the name of the key, and
187 \fIsecret\fR
188 is the base64 encoded shared secret\&.
189 \fIhmac\fR
190 is the name of the key algorithm; valid choices are
191 hmac\-md5,
192 hmac\-sha1,
193 hmac\-sha224,
194 hmac\-sha256,
195 hmac\-sha384, or
196 hmac\-sha512\&. If
197 \fIhmac\fR
198 is not specified, the default is
199 hmac\-md5\&.
200 .sp
201 NOTE: Use of the
202 \fB\-y\fR
203 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
204 \fBps\fR(1)
205 or in a history file maintained by the user\*(Aqs shell\&.
206 .RE
207 .SH "INPUT FORMAT"
208 .PP
209 \fBnsupdate\fR
210 reads input from
211 \fIfilename\fR
212 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\&.
213 .PP
214 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
215 \fBsend\fR
216 command) causes the accumulated commands to be sent as one Dynamic DNS update request to the name server\&.
217 .PP
218 The command formats and their meaning are as follows:
219 .PP
220 \fBserver\fR {servername} [port]
221 .RS 4
222 Sends all dynamic update requests to the name server
223 \fIservername\fR\&. When no server statement is provided,
224 \fBnsupdate\fR
225 will send updates to the master server of the correct zone\&. The MNAME field of that zone\*(Aqs SOA record will identify the master server for that zone\&.
226 \fIport\fR
227 is the port number on
228 \fIservername\fR
229 where the dynamic update requests get sent\&. If no port number is specified, the default DNS port number of 53 is used\&.
230 .RE
231 .PP
232 \fBlocal\fR {address} [port]
233 .RS 4
234 Sends all dynamic update requests using the local
235 \fIaddress\fR\&. When no local statement is provided,
236 \fBnsupdate\fR
237 will send updates using an address and port chosen by the system\&.
238 \fIport\fR
239 can additionally be used to make requests come from a specific port\&. If no port number is specified, the system will assign one\&.
240 .RE
241 .PP
242 \fBzone\fR {zonename}
243 .RS 4
244 Specifies that all updates are to be made to the zone
245 \fIzonename\fR\&. If no
246 \fIzone\fR
247 statement is provided,
248 \fBnsupdate\fR
249 will attempt determine the correct zone to update based on the rest of the input\&.
250 .RE
251 .PP
252 \fBclass\fR {classname}
253 .RS 4
254 Specify the default class\&. If no
255 \fIclass\fR
256 is specified, the default class is
257 \fIIN\fR\&.
258 .RE
259 .PP
260 \fBttl\fR {seconds}
261 .RS 4
262 Specify the default time to live for records to be added\&. The value
263 \fInone\fR
264 will clear the default ttl\&.
265 .RE
266 .PP
267 \fBkey\fR [hmac:] {keyname} {secret}
268 .RS 4
269 Specifies that all updates are to be TSIG\-signed using the
270 \fIkeyname\fR\fIsecret\fR
271 pair\&. If
272 \fIhmac\fR
273 is specified, then it sets the signing algorithm in use; the default is
274 hmac\-md5\&. The
275 \fBkey\fR
276 command overrides any key specified on the command line via
277 \fB\-y\fR
278 or
279 \fB\-k\fR\&.
280 .RE
281 .PP
282 \fBgsstsig\fR
283 .RS 4
284 Use GSS\-TSIG to sign the updated\&. This is equivalent to specifying
285 \fB\-g\fR
286 on the commandline\&.
287 .RE
288 .PP
289 \fBoldgsstsig\fR
290 .RS 4
291 Use the Windows 2000 version of GSS\-TSIG to sign the updated\&. This is equivalent to specifying
292 \fB\-o\fR
293 on the commandline\&.
294 .RE
295 .PP
296 \fBrealm\fR {[realm_name]}
297 .RS 4
298 When using GSS\-TSIG use
299 \fIrealm_name\fR
300 rather than the default realm in
301 krb5\&.conf\&. If no realm is specified the saved realm is cleared\&.
302 .RE
303 .PP
304 \fB[prereq]\fR\fB nxdomain\fR {domain\-name}
305 .RS 4
306 Requires that no resource record of any type exists with name
307 \fIdomain\-name\fR\&.
308 .RE
309 .PP
310 \fB[prereq]\fR\fB yxdomain\fR {domain\-name}
311 .RS 4
312 Requires that
313 \fIdomain\-name\fR
314 exists (has as at least one resource record, of any type)\&.
315 .RE
316 .PP
317 \fB[prereq]\fR\fB nxrrset\fR {domain\-name} [class] {type}
318 .RS 4
319 Requires that no resource record exists of the specified
320 \fItype\fR,
321 \fIclass\fR
322 and
323 \fIdomain\-name\fR\&. If
324 \fIclass\fR
325 is omitted, IN (internet) is assumed\&.
326 .RE
327 .PP
328 \fB[prereq]\fR\fB yxrrset\fR {domain\-name} [class] {type}
329 .RS 4
330 This requires that a resource record of the specified
331 \fItype\fR,
332 \fIclass\fR
333 and
334 \fIdomain\-name\fR
335 must exist\&. If
336 \fIclass\fR
337 is omitted, IN (internet) is assumed\&.
338 .RE
339 .PP
340 \fB[prereq]\fR\fB yxrrset\fR {domain\-name} [class] {type} {data...}
341 .RS 4
342 The
343 \fIdata\fR
344 from each set of prerequisites of this form sharing a common
345 \fItype\fR,
346 \fIclass\fR, and
347 \fIdomain\-name\fR
348 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
349 \fItype\fR,
350 \fIclass\fR, and
351 \fIdomain\-name\fR\&. The
352 \fIdata\fR
353 are written in the standard text representation of the resource record\*(Aqs RDATA\&.
354 .RE
355 .PP
356 \fB[update]\fR\fB del\fR\fB[ete]\fR {domain\-name} [ttl] [class] [type\ [data...]]
357 .RS 4
358 Deletes any resource records named
359 \fIdomain\-name\fR\&. If
360 \fItype\fR
361 and
362 \fIdata\fR
363 is provided, only matching resource records will be removed\&. The internet class is assumed if
364 \fIclass\fR
365 is not supplied\&. The
366 \fIttl\fR
367 is ignored, and is only allowed for compatibility\&.
368 .RE
369 .PP
370 \fB[update]\fR\fB add\fR {domain\-name} {ttl} [class] {type} {data...}
371 .RS 4
372 Adds a new resource record with the specified
373 \fIttl\fR,
374 \fIclass\fR
375 and
376 \fIdata\fR\&.
377 .RE
378 .PP
379 \fBshow\fR
380 .RS 4
381 Displays the current message, containing all of the prerequisites and updates specified since the last send\&.
382 .RE
383 .PP
384 \fBsend\fR
385 .RS 4
386 Sends the current message\&. This is equivalent to entering a blank line\&.
387 .RE
388 .PP
389 \fBanswer\fR
390 .RS 4
391 Displays the answer\&.
392 .RE
393 .PP
394 \fBdebug\fR
395 .RS 4
396 Turn on debugging\&.
397 .RE
398 .PP
399 \fBversion\fR
400 .RS 4
401 Print version number\&.
402 .RE
403 .PP
404 \fBhelp\fR
405 .RS 4
406 Print a list of commands\&.
407 .RE
408 .PP
409 Lines beginning with a semicolon are comments and are ignored\&.
410 .SH "EXAMPLES"
411 .PP
412 The examples below show how
413 \fBnsupdate\fR
414 could be used to insert and delete resource records from the
415 \fBexample\&.com\fR
416 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
417 \fBexample\&.com\fR\&.
418 .sp
419 .if n \{\
420 .RS 4
421 .\}
422 .nf
423 # nsupdate
424 > update delete oldhost\&.example\&.com A
425 > update add newhost\&.example\&.com 86400 A 172\&.16\&.1\&.1
426 > send
427 .fi
428 .if n \{\
429 .RE
430 .\}
431 .PP
432 Any A records for
433 \fBoldhost\&.example\&.com\fR
434 are deleted\&. And an A record for
435 \fBnewhost\&.example\&.com\fR
436 with IP address 172\&.16\&.1\&.1 is added\&. The newly\-added record has a 1 day TTL (86400 seconds)\&.
437 .sp
438 .if n \{\
439 .RS 4
440 .\}
441 .nf
442 # nsupdate
443 > prereq nxdomain nickname\&.example\&.com
444 > update add nickname\&.example\&.com 86400 CNAME somehost\&.example\&.com
445 > send
446 .fi
447 .if n \{\
448 .RE
449 .\}
450 .PP
451 The prerequisite condition gets the name server to check that there are no resource records of any type for
452 \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\&.)
453 .SH "FILES"
454 .PP
455 \fB/etc/resolv\&.conf\fR
456 .RS 4
457 used to identify default name server
458 .RE
459 .PP
460 \fB/var/run/named/session\&.key\fR
461 .RS 4
462 sets the default TSIG key for use in local\-only mode
463 .RE
464 .PP
465 \fBK{name}\&.+157\&.+{random}\&.key\fR
466 .RS 4
467 base\-64 encoding of HMAC\-MD5 key created by
468 \fBdnssec-keygen\fR(8)\&.
469 .RE
470 .PP
471 \fBK{name}\&.+157\&.+{random}\&.private\fR
472 .RS 4
473 base\-64 encoding of HMAC\-MD5 key created by
474 \fBdnssec-keygen\fR(8)\&.
475 .RE
476 .SH "SEE ALSO"
477 .PP
478 RFC 2136,
479 RFC 3007,
480 RFC 2104,
481 RFC 2845,
482 RFC 1034,
483 RFC 2535,
484 RFC 2931,
485 \fBnamed\fR(8),
486 \fBddns-confgen\fR(8),
487 \fBdnssec-keygen\fR(8)\&.
488 .SH "BUGS"
489 .PP
490 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\&.
491 .SH "AUTHOR"
492 .PP
493 \fBInternet Systems Consortium, Inc\&.\fR
494 .SH "COPYRIGHT"
495 .br
496 Copyright \(co 2004-2012, 2014, 2015 Internet Systems Consortium, Inc. ("ISC")
497 .br
498 Copyright \(co 2000-2003 Internet Software Consortium.
499 .br