]> CyberLeo.Net >> Repos - FreeBSD/releng/7.2.git/blob - contrib/bind9/bin/nsupdate/nsupdate.1
Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.
[FreeBSD/releng/7.2.git] / contrib / bind9 / bin / nsupdate / nsupdate.1
1 .\" Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
2 .\" Copyright (C) 2000-2003 Internet Software Consortium.
3 .\" 
4 .\" Permission to use, copy, modify, and 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: nsupdate.1,v 1.1.4.2 2008/09/01 02:29:00 tbox Exp $
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: Jun 30, 2000
24 .\"    Manual: BIND9
25 .\"    Source: BIND9
26 .\"
27 .TH "NSUPDATE" "1" "Jun 30, 2000" "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\-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\-v\fR] [filename]
37 .SH "DESCRIPTION"
38 .PP
39 \fBnsupdate\fR
40 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. 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 Transaction signatures can be used to authenticate the Dynamic DNS updates. These use the TSIG resource record type described in RFC2845 or the SIG(0) record described in RFC3535 and RFC2931. TSIG relies on a shared secret that should only be known to
57 \fBnsupdate\fR
58 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
59 \fBkey\fR
60 and
61 \fBserver\fR
62 statements would be added to
63 \fI/etc/named.conf\fR
64 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.
65 \fBnsupdate\fR
66 does not read
67 \fI/etc/named.conf\fR.
68 .PP
69 \fBnsupdate\fR
70 uses the
71 \fB\-y\fR
72 or
73 \fB\-k\fR
74 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. With the
75 \fB\-k\fR
76 option,
77 \fBnsupdate\fR
78 reads the shared secret from the file
79 \fIkeyfile\fR, whose name is of the form
80 \fIK{name}.+157.+{random}.private\fR. For historical reasons, the file
81 \fIK{name}.+157.+{random}.key\fR
82 must also be present. When the
83 \fB\-y\fR
84 option is used, a signature is generated from
85 [\fIhmac:\fR]\fIkeyname:secret.\fR
86 \fIkeyname\fR
87 is the name of the key, and
88 \fIsecret\fR
89 is the base64 encoded shared secret. Use of the
90 \fB\-y\fR
91 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
92 \fBps\fR(1)
93 or in a history file maintained by the user's shell.
94 .PP
95 The
96 \fB\-k\fR
97 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.
98 .PP
99 By default
100 \fBnsupdate\fR
101 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
102 \fB\-v\fR
103 option makes
104 \fBnsupdate\fR
105 use a TCP connection. This may be preferable when a batch of update requests is made.
106 .PP
107 The
108 \fB\-t\fR
109 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.
110 .PP
111 The
112 \fB\-u\fR
113 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.
114 .PP
115 The
116 \fB\-r\fR
117 option sets the number of UDP retries. The default is 3. If zero, only one update request will be made.
118 .SH "INPUT FORMAT"
119 .PP
120 \fBnsupdate\fR
121 reads input from
122 \fIfilename\fR
123 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.
124 .PP
125 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
126 \fBsend\fR
127 command) causes the accumulated commands to be sent as one Dynamic DNS update request to the name server.
128 .PP
129 The command formats and their meaning are as follows:
130 .PP
131 \fBserver\fR {servername} [port]
132 .RS 4
133 Sends all dynamic update requests to the name server
134 \fIservername\fR. When no server statement is provided,
135 \fBnsupdate\fR
136 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.
137 \fIport\fR
138 is the port number on
139 \fIservername\fR
140 where the dynamic update requests get sent. If no port number is specified, the default DNS port number of 53 is used.
141 .RE
142 .PP
143 \fBlocal\fR {address} [port]
144 .RS 4
145 Sends all dynamic update requests using the local
146 \fIaddress\fR. When no local statement is provided,
147 \fBnsupdate\fR
148 will send updates using an address and port chosen by the system.
149 \fIport\fR
150 can additionally be used to make requests come from a specific port. If no port number is specified, the system will assign one.
151 .RE
152 .PP
153 \fBzone\fR {zonename}
154 .RS 4
155 Specifies that all updates are to be made to the zone
156 \fIzonename\fR. If no
157 \fIzone\fR
158 statement is provided,
159 \fBnsupdate\fR
160 will attempt determine the correct zone to update based on the rest of the input.
161 .RE
162 .PP
163 \fBclass\fR {classname}
164 .RS 4
165 Specify the default class. If no
166 \fIclass\fR
167 is specified, the default class is
168 \fIIN\fR.
169 .RE
170 .PP
171 \fBkey\fR {name} {secret}
172 .RS 4
173 Specifies that all updates are to be TSIG\-signed using the
174 \fIkeyname\fR
175 \fIkeysecret\fR
176 pair. The
177 \fBkey\fR
178 command overrides any key specified on the command line via
179 \fB\-y\fR
180 or
181 \fB\-k\fR.
182 .RE
183 .PP
184 \fBprereq nxdomain\fR {domain\-name}
185 .RS 4
186 Requires that no resource record of any type exists with name
187 \fIdomain\-name\fR.
188 .RE
189 .PP
190 \fBprereq yxdomain\fR {domain\-name}
191 .RS 4
192 Requires that
193 \fIdomain\-name\fR
194 exists (has as at least one resource record, of any type).
195 .RE
196 .PP
197 \fBprereq nxrrset\fR {domain\-name} [class] {type}
198 .RS 4
199 Requires that no resource record exists of the specified
200 \fItype\fR,
201 \fIclass\fR
202 and
203 \fIdomain\-name\fR. If
204 \fIclass\fR
205 is omitted, IN (internet) is assumed.
206 .RE
207 .PP
208 \fBprereq yxrrset\fR {domain\-name} [class] {type}
209 .RS 4
210 This requires that a resource record of the specified
211 \fItype\fR,
212 \fIclass\fR
213 and
214 \fIdomain\-name\fR
215 must exist. If
216 \fIclass\fR
217 is omitted, IN (internet) is assumed.
218 .RE
219 .PP
220 \fBprereq yxrrset\fR {domain\-name} [class] {type} {data...}
221 .RS 4
222 The
223 \fIdata\fR
224 from each set of prerequisites of this form sharing a common
225 \fItype\fR,
226 \fIclass\fR, and
227 \fIdomain\-name\fR
228 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
229 \fItype\fR,
230 \fIclass\fR, and
231 \fIdomain\-name\fR. The
232 \fIdata\fR
233 are written in the standard text representation of the resource record's RDATA.
234 .RE
235 .PP
236 \fBupdate delete\fR {domain\-name} [ttl] [class] [type\ [data...]]
237 .RS 4
238 Deletes any resource records named
239 \fIdomain\-name\fR. If
240 \fItype\fR
241 and
242 \fIdata\fR
243 is provided, only matching resource records will be removed. The internet class is assumed if
244 \fIclass\fR
245 is not supplied. The
246 \fIttl\fR
247 is ignored, and is only allowed for compatibility.
248 .RE
249 .PP
250 \fBupdate add\fR {domain\-name} {ttl} [class] {type} {data...}
251 .RS 4
252 Adds a new resource record with the specified
253 \fIttl\fR,
254 \fIclass\fR
255 and
256 \fIdata\fR.
257 .RE
258 .PP
259 \fBshow\fR
260 .RS 4
261 Displays the current message, containing all of the prerequisites and updates specified since the last send.
262 .RE
263 .PP
264 \fBsend\fR
265 .RS 4
266 Sends the current message. This is equivalent to entering a blank line.
267 .RE
268 .PP
269 \fBanswer\fR
270 .RS 4
271 Displays the answer.
272 .RE
273 .PP
274 Lines beginning with a semicolon are comments and are ignored.
275 .SH "EXAMPLES"
276 .PP
277 The examples below show how
278 \fBnsupdate\fR
279 could be used to insert and delete resource records from the
280 \fBexample.com\fR
281 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
282 \fBexample.com\fR.
283 .sp
284 .RS 4
285 .nf
286 # nsupdate
287 > update delete oldhost.example.com A
288 > update add newhost.example.com 86400 A 172.16.1.1
289 > send
290 .fi
291 .RE
292 .sp
293 .PP
294 Any A records for
295 \fBoldhost.example.com\fR
296 are deleted. And an A record for
297 \fBnewhost.example.com\fR
298 with IP address 172.16.1.1 is added. The newly\-added record has a 1 day TTL (86400 seconds).
299 .sp
300 .RS 4
301 .nf
302 # nsupdate
303 > prereq nxdomain nickname.example.com
304 > update add nickname.example.com 86400 CNAME somehost.example.com
305 > send
306 .fi
307 .RE
308 .sp
309 .PP
310 The prerequisite condition gets the name server to check that there are no resource records of any type for
311 \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 RRSIG, DNSKEY and NSEC records.)
312 .SH "FILES"
313 .PP
314 \fB/etc/resolv.conf\fR
315 .RS 4
316 used to identify default name server
317 .RE
318 .PP
319 \fBK{name}.+157.+{random}.key\fR
320 .RS 4
321 base\-64 encoding of HMAC\-MD5 key created by
322 \fBdnssec\-keygen\fR(8).
323 .RE
324 .PP
325 \fBK{name}.+157.+{random}.private\fR
326 .RS 4
327 base\-64 encoding of HMAC\-MD5 key created by
328 \fBdnssec\-keygen\fR(8).
329 .RE
330 .SH "SEE ALSO"
331 .PP
332 \fBRFC2136\fR(),
333 \fBRFC3007\fR(),
334 \fBRFC2104\fR(),
335 \fBRFC2845\fR(),
336 \fBRFC1034\fR(),
337 \fBRFC2535\fR(),
338 \fBRFC2931\fR(),
339 \fBnamed\fR(8),
340 \fBdnssec\-keygen\fR(8).
341 .SH "BUGS"
342 .PP
343 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.
344 .SH "COPYRIGHT"
345 Copyright \(co 2004\-2008 Internet Systems Consortium, Inc. ("ISC")
346 .br
347 Copyright \(co 2000\-2003 Internet Software Consortium.
348 .br