Merge branch 'vendor/LIBPCAP' (early part)
[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.9 2006/06/29 13:02:30 marka Exp $
17 .\"
18 .hy 0
19 .ad l
20 .\"     Title: nsupdate
21 .\"    Author: 
22 .\" Generator: DocBook XSL Stylesheets v1.70.1 <http://docbook.sf.net/>
23 .\"      Date: Jun 30, 2000
24 .\"    Manual: BIND9
25 .\"    Source: BIND9
26 .\"
27 .TH "NSUPDATE" "8" "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\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 (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
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 \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 a 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 .TP 3n
131 .HP 7 \fBserver\fR {servername} [port]
132 Sends all dynamic update requests to the name server
133 \fIservername\fR. When no server statement is provided,
134 \fBnsupdate\fR
135 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.
136 \fIport\fR
137 is the port number on
138 \fIservername\fR
139 where the dynamic update requests get sent. If no port number is specified, the default DNS port number of 53 is used.
140 .TP 3n
141 .HP 6 \fBlocal\fR {address} [port]
142 Sends all dynamic update requests using the local
143 \fIaddress\fR. When no local statement is provided,
144 \fBnsupdate\fR
145 will send updates using an address and port chosen by the system.
146 \fIport\fR
147 can additionally be used to make requests come from a specific port. If no port number is specified, the system will assign one.
148 .TP 3n
149 .HP 5 \fBzone\fR {zonename}
150 Specifies that all updates are to be made to the zone
151 \fIzonename\fR. If no
152 \fIzone\fR
153 statement is provided,
154 \fBnsupdate\fR
155 will attempt determine the correct zone to update based on the rest of the input.
156 .TP 3n
157 .HP 6 \fBclass\fR {classname}
158 Specify the default class. If no
159 \fIclass\fR
160 is specified the default class is
161 \fIIN\fR.
162 .TP 3n
163 .HP 4 \fBkey\fR {name} {secret}
164 Specifies that all updates are to be TSIG signed using the
165 \fIkeyname\fR
166 \fIkeysecret\fR
167 pair. The
168 \fBkey\fR
169 command overrides any key specified on the command line via
170 \fB\-y\fR
171 or
172 \fB\-k\fR.
173 .TP 3n
174 .HP 16 \fBprereq nxdomain\fR {domain\-name}
175 Requires that no resource record of any type exists with name
176 \fIdomain\-name\fR.
177 .TP 3n
178 .HP 16 \fBprereq yxdomain\fR {domain\-name}
179 Requires that
180 \fIdomain\-name\fR
181 exists (has as at least one resource record, of any type).
182 .TP 3n
183 .HP 15 \fBprereq nxrrset\fR {domain\-name} [class] {type}
184 Requires that no resource record exists of the specified
185 \fItype\fR,
186 \fIclass\fR
187 and
188 \fIdomain\-name\fR. If
189 \fIclass\fR
190 is omitted, IN (internet) is assumed.
191 .TP 3n
192 .HP 15 \fBprereq yxrrset\fR {domain\-name} [class] {type}
193 This requires that a resource record of the specified
194 \fItype\fR,
195 \fIclass\fR
196 and
197 \fIdomain\-name\fR
198 must exist. If
199 \fIclass\fR
200 is omitted, IN (internet) is assumed.
201 .TP 3n
202 .HP 15 \fBprereq yxrrset\fR {domain\-name} [class] {type} {data...}
203 The
204 \fIdata\fR
205 from each set of prerequisites of this form sharing a common
206 \fItype\fR,
207 \fIclass\fR, and
208 \fIdomain\-name\fR
209 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
210 \fItype\fR,
211 \fIclass\fR, and
212 \fIdomain\-name\fR. The
213 \fIdata\fR
214 are written in the standard text representation of the resource record's RDATA.
215 .TP 3n
216 .HP 14 \fBupdate delete\fR {domain\-name} [ttl] [class] [type\ [data...]]
217 Deletes any resource records named
218 \fIdomain\-name\fR. If
219 \fItype\fR
220 and
221 \fIdata\fR
222 is provided, only matching resource records will be removed. The internet class is assumed if
223 \fIclass\fR
224 is not supplied. The
225 \fIttl\fR
226 is ignored, and is only allowed for compatibility.
227 .TP 3n
228 .HP 11 \fBupdate add\fR {domain\-name} {ttl} [class] {type} {data...}
229 Adds a new resource record with the specified
230 \fIttl\fR,
231 \fIclass\fR
232 and
233 \fIdata\fR.
234 .TP 3n
235 .HP 5 \fBshow\fR
236 Displays the current message, containing all of the prerequisites and updates specified since the last send.
237 .TP 3n
238 .HP 5 \fBsend\fR
239 Sends the current message. This is equivalent to entering a blank line.
240 .TP 3n
241 .HP 7 \fBanswer\fR
242 Displays the answer.
243 .PP
244 Lines beginning with a semicolon are comments and are ignored.
245 .SH "EXAMPLES"
246 .PP
247 The examples below show how
248 \fBnsupdate\fR
249 could be used to insert and delete resource records from the
250 \fBexample.com\fR
251 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
252 \fBexample.com\fR.
253 .sp
254 .RS 3n
255 .nf
256 # nsupdate
257 > update delete oldhost.example.com A
258 > update add newhost.example.com 86400 A 172.16.1.1
259 > send
260 .fi
261 .RE
262 .sp
263 .PP
264 Any A records for
265 \fBoldhost.example.com\fR
266 are deleted. and an A record for
267 \fBnewhost.example.com\fR
268 it IP address 172.16.1.1 is added. The newly\-added record has a 1 day TTL (86400 seconds)
269 .sp
270 .RS 3n
271 .nf
272 # nsupdate
273 > prereq nxdomain nickname.example.com
274 > update add nickname.example.com 86400 CNAME somehost.example.com
275 > send
276 .fi
277 .RE
278 .sp
279 .PP
280 The prerequisite condition gets the name server to check that there are no resource records of any type for
281 \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.)
282 .SH "FILES"
283 .TP 3n
284 \fB/etc/resolv.conf\fR
285 used to identify default name server
286 .TP 3n
287 \fBK{name}.+157.+{random}.key\fR
288 base\-64 encoding of HMAC\-MD5 key created by
289 \fBdnssec\-keygen\fR(8).
290 .TP 3n
291 \fBK{name}.+157.+{random}.private\fR
292 base\-64 encoding of HMAC\-MD5 key created by
293 \fBdnssec\-keygen\fR(8).
294 .SH "SEE ALSO"
295 .PP
296 \fBRFC2136\fR(),
297 \fBRFC3007\fR(),
298 \fBRFC2104\fR(),
299 \fBRFC2845\fR(),
300 \fBRFC1034\fR(),
301 \fBRFC2535\fR(),
302 \fBRFC2931\fR(),
303 \fBnamed\fR(8),
304 \fBdnssec\-keygen\fR(8).
305 .SH "BUGS"
306 .PP
307 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.
308 .SH "COPYRIGHT"
309 Copyright \(co 2004, 2005 Internet Systems Consortium, Inc. ("ISC")