Merge from vendor branch SENDMAIL:
[dragonfly.git] / contrib / bind-9.2.4rc7 / bin / nsupdate / nsupdate.8
1 .\" Copyright (C) 2004  Internet Systems Consortium, Inc. ("ISC")
2 .\" Copyright (C) 2000, 2001, 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.8,v 1.24.2.4 2004/03/15 04:44:41 marka Exp $
17 .\"
18 .TH "NSUPDATE" "8" "Jun 30, 2000" "BIND9" ""
19 .SH NAME
20 nsupdate \- Dynamic DNS update utility
21 .SH SYNOPSIS
22 .sp
23 \fBnsupdate\fR [ \fB-d\fR ]  [ \fB [ -y \fIkeyname:secret\fB ]  [ -k \fIkeyfile\fB ] \fR ]  [ \fB-v\fR ]  [ \fBfilename\fR ] 
24 .SH "DESCRIPTION"
25 .PP
26 \fBnsupdate\fR
27 is used to submit Dynamic DNS Update requests as defined in RFC2136
28 to a name server.
29 This allows resource records to be added or removed from a zone
30 without manually editing the zone file.
31 A single update request can contain requests to add or remove more than one
32 resource record.
33 .PP
34 Zones that are under dynamic control via
35 \fBnsupdate\fR
36 or a DHCP server should not be edited by hand.
37 Manual edits could
38 conflict with dynamic updates and cause data to be lost.
39 .PP
40 The resource records that are dynamically added or removed with
41 \fBnsupdate\fR
42 have to be in the same zone.
43 Requests are sent to the zone's master server.
44 This is identified by the MNAME field of the zone's SOA record.
45 .PP
46 The
47 \fB-d\fR
48 option makes
49 \fBnsupdate\fR
50 operate in debug mode.
51 This provides tracing information about the update requests that are
52 made and the replies received from the name server.
53 .PP
54 Transaction signatures can be used to authenticate the Dynamic DNS
55 updates.
56 These use the TSIG resource record type described in RFC2845.
57 The signatures rely on a shared secret that should only be known to
58 \fBnsupdate\fR
59 and the name server.
60 Currently, the only supported encryption algorithm for TSIG is
61 HMAC-MD5, which is defined in RFC 2104.
62 Once other algorithms are defined for TSIG, applications will need to
63 ensure they select the appropriate algorithm as well as the key when
64 authenticating each other.
65 For instance suitable
66 \fBkey\fR
67 and
68 \fBserver\fR
69 statements would be added to
70 \fI/etc/named.conf\fR
71 so that the name server can associate the appropriate secret key
72 and algorithm with the IP address of the
73 client application that will be using TSIG authentication.
74 \fBnsupdate\fR
75 does not read
76 \fI/etc/named.conf\fR.
77 .PP
78 \fBnsupdate\fR
79 uses the
80 \fB-y\fR
81 or
82 \fB-k\fR
83 option to provide the shared secret needed to generate a TSIG record
84 for authenticating Dynamic DNS update requests.
85 These options are mutually exclusive.
86 With the
87 \fB-k\fR
88 option,
89 \fBnsupdate\fR
90 reads the shared secret from the file
91 \fIkeyfile\fR,
92 whose name is of the form 
93 \fIK{name}.+157.+{random}.private\fR.
94 For historical
95 reasons, the file 
96 \fIK{name}.+157.+{random}.key\fR
97 must also be present. When the
98 \fB-y\fR
99 option is used, a signature is generated from
100 \fIkeyname:secret.\fR
101 \fIkeyname\fR
102 is the name of the key,
103 and
104 \fIsecret\fR
105 is the base64 encoded shared secret.
106 Use of the
107 \fB-y\fR
108 option is discouraged because the shared secret is supplied as a command
109 line argument in clear text.
110 This may be visible in the output from
111 \fBps\fR(1)
112 or in a history file maintained by the user's shell.
113 .PP
114 By default
115 \fBnsupdate\fR
116 uses UDP to send update requests to the name server.
117 The
118 \fB-v\fR
119 option makes
120 \fBnsupdate\fR
121 use a TCP connection.
122 This may be preferable when a batch of update requests is made.
123 .SH "INPUT FORMAT"
124 .PP
125 \fBnsupdate\fR
126 reads input from
127 \fIfilename\fR
128 or standard input.
129 Each command is supplied on exactly one line of input.
130 Some commands are for administrative purposes.
131 The others are either update instructions or prerequisite checks on the
132 contents of the zone.
133 These checks set conditions that some name or set of
134 resource records (RRset) either exists or is absent from the zone.
135 These conditions must be met if the entire update request is to succeed.
136 Updates will be rejected if the tests for the prerequisite conditions fail.
137 .PP
138 Every update request consists of zero or more prerequisites
139 and zero or more updates.
140 This allows a suitably authenticated update request to proceed if some
141 specified resource records are present or missing from the zone.
142 A blank input line (or the \fBsend\fR command) causes the
143 accumulated commands to be sent as one Dynamic DNS update request to the
144 name server.
145 .PP
146 The command formats and their meaning are as follows:
147 .TP
148 \fBserver servername [ port ]\fR
149 Sends all dynamic update requests to the name server
150 \fIservername\fR.
151 When no server statement is provided,
152 \fBnsupdate\fR
153 will send updates to the master server of the correct zone.
154 The MNAME field of that zone's SOA record will identify the master
155 server for that zone.
156 \fIport\fR
157 is the port number on
158 \fIservername\fR
159 where the dynamic update requests get sent.
160 If no port number is specified, the default DNS port number of 53 is
161 used.
162 .TP
163 \fBlocal address [ port ]\fR
164 Sends all dynamic update requests using the local
165 \fIaddress\fR.
166 When no local statement is provided,
167 \fBnsupdate\fR
168 will send updates using an address and port chosen by the system.
169 \fIport\fR
170 can additionally be used to make requests come from a specific port.
171 If no port number is specified, the system will assign one.
172 .TP
173 \fBzone zonename\fR
174 Specifies that all updates are to be made to the zone
175 \fIzonename\fR.
176 If no
177 \fIzone\fR
178 statement is provided,
179 \fBnsupdate\fR
180 will attempt determine the correct zone to update based on the rest of the input.
181 .TP
182 \fBclass classname\fR
183 Specify the default class.
184 If no \fIclass\fR is specified the default class is
185 \fIIN\fR.
186 .TP
187 \fBkey name secret\fR
188 Specifies that all updates are to be TSIG signed using the
189 \fIkeyname\fR \fIkeysecret\fR pair.
190 The \fBkey\fR command
191 overrides any key specified on the command line via
192 \fB-y\fR or \fB-k\fR.
193 .TP
194 \fBprereq nxdomain domain-name\fR
195 Requires that no resource record of any type exists with name
196 \fIdomain-name\fR.
197 .TP
198 \fBprereq yxdomain domain-name\fR
199 Requires that
200 \fIdomain-name\fR
201 exists (has as at least one resource record, of any type).
202 .TP
203 \fBprereq nxrrset domain-name [ class ]  type\fR
204 Requires that no resource record exists of the specified
205 \fItype\fR,
206 \fIclass\fR
207 and
208 \fIdomain-name\fR.
209 If
210 \fIclass\fR
211 is omitted, IN (internet) is assumed.
212 .TP
213 \fBprereq yxrrset domain-name [ class ]  type\fR
214 This requires that a resource record of the specified
215 \fItype\fR,
216 \fIclass\fR
217 and
218 \fIdomain-name\fR
219 must exist.
220 If
221 \fIclass\fR
222 is omitted, IN (internet) is assumed.
223 .TP
224 \fBprereq yxrrset domain-name [ class ]  type data\fI...\fB\fR
225 The
226 \fIdata\fR
227 from each set of prerequisites of this form
228 sharing a common
229 \fItype\fR,
230 \fIclass\fR,
231 and 
232 \fIdomain-name\fR
233 are combined to form a set of RRs. This set of RRs must
234 exactly match the set of RRs existing in the zone at the
235 given 
236 \fItype\fR,
237 \fIclass\fR,
238 and 
239 \fIdomain-name\fR.
240 The
241 \fIdata\fR
242 are written in the standard text representation of the resource record's
243 RDATA.
244 .TP
245 \fBupdate delete domain-name [ ttl ]  [ class ]  [ type  [ data\fI...\fB ]  ]\fR
246 Deletes any resource records named
247 \fIdomain-name\fR.
248 If
249 \fItype\fR
250 and
251 \fIdata\fR
252 is provided, only matching resource records will be removed.
253 The internet class is assumed if
254 \fIclass\fR
255 is not supplied. The
256 \fIttl\fR
257 is ignored, and is only allowed for compatibility.
258 .TP
259 \fBupdate add domain-name ttl [ class ]  type data\fI...\fB\fR
260 Adds a new resource record with the specified
261 \fIttl\fR,
262 \fIclass\fR
263 and
264 \fIdata\fR.
265 .TP
266 \fBshow\fR
267 Displays the current message, containing all of the prerequisites and
268 updates specified since the last send.
269 .TP
270 \fBsend\fR
271 Sends the current message. This is equivalent to entering a blank line.
272 .PP
273 Lines beginning with a semicolon are comments and are ignored.
274 .SH "EXAMPLES"
275 .PP
276 The examples below show how
277 \fBnsupdate\fR
278 could be used to insert and delete resource records from the
279 \fBexample.com\fR
280 zone.
281 Notice that the input in each example contains a trailing blank line so that
282 a group of commands are sent as one dynamic update request to the
283 master name server for
284 \fBexample.com\fR.
285 .sp
286 .nf
287 # nsupdate
288 > update delete oldhost.example.com A
289 > update add newhost.example.com 86400 A 172.16.1.1
290 > send
291 .sp
292 .fi
293 .PP
294 Any A records for
295 \fBoldhost.example.com\fR
296 are deleted.
297 and an A record for
298 \fBnewhost.example.com\fR
299 it IP address 172.16.1.1 is added.
300 The newly-added record has a 1 day TTL (86400 seconds)
301 .sp
302 .nf
303 # nsupdate
304 > prereq nxdomain nickname.example.com
305 > update add nickname.example.com 86400 CNAME somehost.example.com
306 > send
307 .sp
308 .fi
309 .PP
310 The prerequisite condition gets the name server to check that there
311 are no resource records of any type for
312 \fBnickname.example.com\fR.
313 If there are, the update request fails.
314 If this name does not exist, a CNAME for it is added.
315 This ensures that when the CNAME is added, it cannot conflict with the
316 long-standing rule in RFC1034 that a name must not exist as any other
317 record type if it exists as a CNAME.
318 (The rule has been updated for DNSSEC in RFC2535 to allow CNAMEs to have
319 SIG, KEY and NXT records.)
320 .SH "FILES"
321 .TP
322 \fB/etc/resolv.conf\fR
323 used to identify default name server
324 .TP
325 \fBK{name}.+157.+{random}.key\fR
326 base-64 encoding of HMAC-MD5 key created by
327 \fBdnssec-keygen\fR(8).
328 .TP
329 \fBK{name}.+157.+{random}.private\fR
330 base-64 encoding of HMAC-MD5 key created by
331 \fBdnssec-keygen\fR(8).
332 .SH "SEE ALSO"
333 .PP
334 \fBRFC2136\fR,
335 \fBRFC3007\fR,
336 \fBRFC2104\fR,
337 \fBRFC2845\fR,
338 \fBRFC1034\fR,
339 \fBRFC2535\fR,
340 \fBnamed\fR(8),
341 \fBdnssec-keygen\fR(8).
342 .SH "BUGS"
343 .PP
344 The TSIG key is redundantly stored in two separate files.
345 This is a consequence of nsupdate using the DST library
346 for its cryptographic operations, and may change in future
347 releases.