Merge from vendor branch GCC:
[dragonfly.git] / contrib / bind-9.3 / bin / nsupdate / nsupdate.8
1 .\" Copyright (C) 2004, 2005 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.8,v 1.24.2.2.2.8 2005/10/13 02:33:48 marka Exp $
17 .\"
18 .hy 0
19 .ad l
20 .\" ** You probably do not want to edit this file directly **
21 .\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
22 .\" Instead of manually editing it, you probably should edit the DocBook XML
23 .\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
24 .TH "NSUPDATE" "8" "Jun 30, 2000" "BIND9" "BIND9"
25 .\" disable hyphenation
26 .nh
27 .\" disable justification (adjust text to left margin only)
28 .ad l
29 .SH "NAME"
30 nsupdate \- Dynamic DNS update utility
31 .SH "SYNOPSIS"
32 .HP 9
33 \fBnsupdate\fR [\fB\-d\fR] [[\fB\-y\ \fR\fB\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]
34 .SH "DESCRIPTION"
35 .PP
36 \fBnsupdate\fR
37 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.
38 .PP
39 Zones that are under dynamic control via
40 \fBnsupdate\fR
41 or a DHCP server should not be edited by hand. Manual edits could conflict with dynamic updates and cause data to be lost.
42 .PP
43 The resource records that are dynamically added or removed with
44 \fBnsupdate\fR
45 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.
46 .PP
47 The
48 \fB\-d\fR
49 option makes
50 \fBnsupdate\fR
51 operate in debug mode. This provides tracing information about the update requests that are made and the replies received from the name server.
52 .PP
53 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
54 \fBnsupdate\fR
55 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
56 \fBkey\fR
57 and
58 \fBserver\fR
59 statements would be added to
60 \fI/etc/named.conf\fR
61 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.
62 \fBnsupdate\fR
63 does not read
64 \fI/etc/named.conf\fR.
65 .PP
66 \fBnsupdate\fR
67 uses the
68 \fB\-y\fR
69 or
70 \fB\-k\fR
71 option (with an HMAC\-MD5 key) to provide the shared secret needed to generate a TSIG record for authenticating Dynamic DNS update requests. These options are mutually exclusive. With the
72 \fB\-k\fR
73 option,
74 \fBnsupdate\fR
75 reads the shared secret from the file
76 \fIkeyfile\fR, whose name is of the form
77 \fIK{name}.+157.+{random}.private\fR. For historical reasons, the file
78 \fIK{name}.+157.+{random}.key\fR
79 must also be present. When the
80 \fB\-y\fR
81 option is used, a signature is generated from
82 \fIkeyname:secret.\fR\fIkeyname\fR
83 is the name of the key, and
84 \fIsecret\fR
85 is the base64 encoded shared secret. Use of the
86 \fB\-y\fR
87 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
88 \fBps\fR(1 )
89 or in a history file maintained by the user's shell.
90 .PP
91 The
92 \fB\-k\fR
93 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.
94 .PP
95 By default
96 \fBnsupdate\fR
97 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
98 \fB\-v\fR
99 option makes
100 \fBnsupdate\fR
101 use a TCP connection. This may be preferable when a batch of update requests is made.
102 .PP
103 The
104 \fB\-t\fR
105 option sets the maximum time a update request can take before it is aborted. The default is 300 seconds. Zero can be used to disable the timeout.
106 .PP
107 The
108 \fB\-u\fR
109 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.
110 .PP
111 The
112 \fB\-r\fR
113 option sets the number of UDP retries. The default is 3. If zero only one update request will be made.
114 .SH "INPUT FORMAT"
115 .PP
116 \fBnsupdate\fR
117 reads input from
118 \fIfilename\fR
119 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.
120 .PP
121 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
122 \fBsend\fR
123 command) causes the accumulated commands to be sent as one Dynamic DNS update request to the name server.
124 .PP
125 The command formats and their meaning are as follows:
126 .TP
127 .HP 7 \fBserver\fR {servername} [port]
128 Sends all dynamic update requests to the name server
129 \fIservername\fR. When no server statement is provided,
130 \fBnsupdate\fR
131 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.
132 \fIport\fR
133 is the port number on
134 \fIservername\fR
135 where the dynamic update requests get sent. If no port number is specified, the default DNS port number of 53 is used.
136 .TP
137 .HP 6 \fBlocal\fR {address} [port]
138 Sends all dynamic update requests using the local
139 \fIaddress\fR. When no local statement is provided,
140 \fBnsupdate\fR
141 will send updates using an address and port chosen by the system.
142 \fIport\fR
143 can additionally be used to make requests come from a specific port. If no port number is specified, the system will assign one.
144 .TP
145 .HP 5 \fBzone\fR {zonename}
146 Specifies that all updates are to be made to the zone
147 \fIzonename\fR. If no
148 \fIzone\fR
149 statement is provided,
150 \fBnsupdate\fR
151 will attempt determine the correct zone to update based on the rest of the input.
152 .TP
153 .HP 6 \fBclass\fR {classname}
154 Specify the default class. If no
155 \fIclass\fR
156 is specified the default class is
157 \fIIN\fR.
158 .TP
159 .HP 4 \fBkey\fR {name} {secret}
160 Specifies that all updates are to be TSIG signed using the
161 \fIkeyname\fR\fIkeysecret\fR
162 pair. The
163 \fBkey\fR
164 command overrides any key specified on the command line via
165 \fB\-y\fR
166 or
167 \fB\-k\fR.
168 .TP
169 .HP 16 \fBprereq nxdomain\fR {domain\-name}
170 Requires that no resource record of any type exists with name
171 \fIdomain\-name\fR.
172 .TP
173 .HP 16 \fBprereq yxdomain\fR {domain\-name}
174 Requires that
175 \fIdomain\-name\fR
176 exists (has as at least one resource record, of any type).
177 .TP
178 .HP 15 \fBprereq nxrrset\fR {domain\-name} [class] {type}
179 Requires that no resource record exists of the specified
180 \fItype\fR,
181 \fIclass\fR
182 and
183 \fIdomain\-name\fR. If
184 \fIclass\fR
185 is omitted, IN (internet) is assumed.
186 .TP
187 .HP 15 \fBprereq yxrrset\fR {domain\-name} [class] {type}
188 This requires that a resource record of the specified
189 \fItype\fR,
190 \fIclass\fR
191 and
192 \fIdomain\-name\fR
193 must exist. If
194 \fIclass\fR
195 is omitted, IN (internet) is assumed.
196 .TP
197 .HP 15 \fBprereq yxrrset\fR {domain\-name} [class] {type} {data...}
198 The
199 \fIdata\fR
200 from each set of prerequisites of this form sharing a common
201 \fItype\fR,
202 \fIclass\fR, and
203 \fIdomain\-name\fR
204 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
205 \fItype\fR,
206 \fIclass\fR, and
207 \fIdomain\-name\fR. The
208 \fIdata\fR
209 are written in the standard text representation of the resource record's RDATA.
210 .TP
211 .HP 14 \fBupdate delete\fR {domain\-name} [ttl] [class] [type\ [data...]]
212 Deletes any resource records named
213 \fIdomain\-name\fR. If
214 \fItype\fR
215 and
216 \fIdata\fR
217 is provided, only matching resource records will be removed. The internet class is assumed if
218 \fIclass\fR
219 is not supplied. The
220 \fIttl\fR
221 is ignored, and is only allowed for compatibility.
222 .TP
223 .HP 11 \fBupdate add\fR {domain\-name} {ttl} [class] {type} {data...}
224 Adds a new resource record with the specified
225 \fIttl\fR,
226 \fIclass\fR
227 and
228 \fIdata\fR.
229 .TP
230 .HP 5 \fBshow\fR
231 Displays the current message, containing all of the prerequisites and updates specified since the last send.
232 .TP
233 .HP 5 \fBsend\fR
234 Sends the current message. This is equivalent to entering a blank line.
235 .TP
236 .HP 7 \fBanswer\fR
237 Displays the answer.
238 .PP
239 Lines beginning with a semicolon are comments and are ignored.
240 .SH "EXAMPLES"
241 .PP
242 The examples below show how
243 \fBnsupdate\fR
244 could be used to insert and delete resource records from the
245 \fBexample.com\fR
246 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
247 \fBexample.com\fR.
248 .sp
249 .nf
250 # nsupdate
251 > update delete oldhost.example.com A
252 > update add newhost.example.com 86400 A 172.16.1.1
253 > send
254 .fi
255 .sp
256 .PP
257 Any A records for
258 \fBoldhost.example.com\fR
259 are deleted. and an A record for
260 \fBnewhost.example.com\fR
261 it IP address 172.16.1.1 is added. The newly\-added record has a 1 day TTL (86400 seconds)
262 .sp
263 .nf
264 # nsupdate
265 > prereq nxdomain nickname.example.com
266 > update add nickname.example.com 86400 CNAME somehost.example.com
267 > send
268 .fi
269 .sp
270 .PP
271 The prerequisite condition gets the name server to check that there are no resource records of any type for
272 \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.)
273 .SH "FILES"
274 .TP
275 \fB/etc/resolv.conf\fR
276 used to identify default name server
277 .TP
278 \fBK{name}.+157.+{random}.key\fR
279 base\-64 encoding of HMAC\-MD5 key created by
280 \fBdnssec\-keygen\fR(8).
281 .TP
282 \fBK{name}.+157.+{random}.private\fR
283 base\-64 encoding of HMAC\-MD5 key created by
284 \fBdnssec\-keygen\fR(8).
285 .SH "SEE ALSO"
286 .PP
287 \fBRFC2136\fR(),
288 \fBRFC3007\fR(),
289 \fBRFC2104\fR(),
290 \fBRFC2845\fR(),
291 \fBRFC1034\fR(),
292 \fBRFC2535\fR(),
293 \fBRFC2931\fR(),
294 \fBnamed\fR(8),
295 \fBdnssec\-keygen\fR(8).
296 .SH "BUGS"
297 .PP
298 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.