1NSUPDATE(1) BIND 9 NSUPDATE(1)
2
3
4
6 nsupdate - dynamic DNS update utility
7
9 nsupdate [-d] [-D] [-i] [-L level] [ [-g] | [-o] | [-l] | [-y
10 [hmac:]keyname:secret] | [-k keyfile] ] [-t timeout] [-u udptimeout]
11 [-r udpretries] [-v] [-T] [-P] [-V] [ [-4] | [-6] ] [filename]
12
14 nsupdate is used to submit Dynamic DNS Update requests, as defined in
15 RFC 2136, to a name server. This allows resource records to be added or
16 removed from a zone without manually editing the zone file. A single
17 update request can contain requests to add or remove more than one re‐
18 source record.
19
20 Zones that are under dynamic control via nsupdate or a DHCP server
21 should not be edited by hand. Manual edits could conflict with dynamic
22 updates and cause data to be lost.
23
24 The resource records that are dynamically added or removed with nsup‐
25 date must be in the same zone. Requests are sent to the zone's primary
26 server, which is identified by the MNAME field of the zone's SOA
27 record.
28
29 Transaction signatures can be used to authenticate the Dynamic DNS up‐
30 dates. These use the TSIG resource record type described in RFC 2845,
31 the SIG(0) record described in RFC 2535 and RFC 2931, or GSS-TSIG as
32 described in RFC 3645.
33
34 TSIG relies on a shared secret that should only be known to nsupdate
35 and the name server. For instance, suitable key and server statements
36 are added to /etc/named.conf so that the name server can associate the
37 appropriate secret key and algorithm with the IP address of the client
38 application that is using TSIG authentication. ddns-confgen can gener‐
39 ate suitable configuration fragments. nsupdate uses the -y or -k op‐
40 tions to provide the TSIG shared secret; these options are mutually ex‐
41 clusive.
42
43 SIG(0) uses public key cryptography. To use a SIG(0) key, the public
44 key must be stored in a KEY record in a zone served by the name server.
45
46 GSS-TSIG uses Kerberos credentials. Standard GSS-TSIG mode is switched
47 on with the -g flag. A non-standards-compliant variant of GSS-TSIG used
48 by Windows 2000 can be switched on with the -o flag.
49
51 -4 This option sets use of IPv4 only.
52
53 -6 This option sets use of IPv6 only.
54
55 -C Overrides the default resolv.conf file. This is only intended
56 for testing.
57
58 -d This option sets debug mode, which provides tracing information
59 about the update requests that are made and the replies received
60 from the name server.
61
62 -D This option sets extra debug mode.
63
64 -g This option enables standard GSS-TSIG mode.
65
66 -i This option forces interactive mode, even when standard input is
67 not a terminal.
68
69 -k keyfile
70 This option indicates the file containing the TSIG authentica‐
71 tion key. Keyfiles may be in two formats: a single file contain‐
72 ing a named.conf-format key statement, which may be generated
73 automatically by ddns-confgen; or a pair of files whose names
74 are of the format K{name}.+157.+{random}.key and
75 K{name}.+157.+{random}.private, which can be generated by
76 dnssec-keygen. The -k option can also be used to specify a
77 SIG(0) key used to authenticate Dynamic DNS update requests. In
78 this case, the key specified is not an HMAC-MD5 key.
79
80 -l This option sets local-host only mode, which sets the server ad‐
81 dress to localhost (disabling the server so that the server ad‐
82 dress cannot be overridden). Connections to the local server use
83 a TSIG key found in /run/session.key, which is automatically
84 generated by named if any local primary zone has set update-pol‐
85 icy to local. The location of this key file can be overridden
86 with the -k option.
87
88 -L level
89 This option sets the logging debug level. If zero, logging is
90 disabled.
91
92 -o This option enables a non-standards-compliant variant of
93 GSS-TSIG used by Windows 2000.
94
95 -p port
96 This option sets the port to use for connections to a name
97 server. The default is 53.
98
99 -P This option prints the list of private BIND-specific resource
100 record types whose format is understood by nsupdate. See also
101 the -T option.
102
103 -r udpretries
104 This option sets the number of UDP retries. The default is 3. If
105 zero, only one update request is made.
106
107 -t timeout
108 This option sets the maximum time an update request can take be‐
109 fore it is aborted. The default is 300 seconds. If zero, the
110 timeout is disabled for TCP mode. For UDP mode, the option -u
111 takes precedence over this option, unless the option -u is set
112 to zero, in which case the interval is computed from the -t
113 timeout interval and the number of UDP retries. For UDP mode,
114 the timeout can not be disabled, and will be rounded up to 1
115 second in case if both -t and -u are set to zero.
116
117 -T This option prints the list of IANA standard resource record
118 types whose format is understood by nsupdate. nsupdate exits af‐
119 ter the lists are printed. The -T option can be combined with
120 the -P option.
121
122 Other types can be entered using TYPEXXXXX where XXXXX is the
123 decimal value of the type with no leading zeros. The rdata, if
124 present, is parsed using the UNKNOWN rdata format, (<backslash>
125 <hash> <space> <length> <space> <hexstring>).
126
127 -u udptimeout
128 This option sets the UDP retry interval. The default is 3 sec‐
129 onds. If zero, the interval is computed from the timeout inter‐
130 val and number of UDP retries.
131
132 -v This option specifies that TCP should be used even for small up‐
133 date requests. By default, nsupdate uses UDP to send update re‐
134 quests to the name server unless they are too large to fit in a
135 UDP request, in which case TCP is used. TCP may be preferable
136 when a batch of update requests is made.
137
138 -V This option prints the version number and exits.
139
140 -y [hmac:]keyname:secret
141 This option sets the literal TSIG authentication key. keyname is
142 the name of the key, and secret is the base64 encoded shared se‐
143 cret. hmac is the name of the key algorithm; valid choices are
144 hmac-md5, hmac-sha1, hmac-sha224, hmac-sha256, hmac-sha384, or
145 hmac-sha512. If hmac is not specified, the default is hmac-md5,
146 or if MD5 was disabled, hmac-sha256.
147
148 NOTE: Use of the -y option is discouraged because the shared se‐
149 cret is supplied as a command-line argument in clear text. This
150 may be visible in the output from ps1 or in a history file main‐
151 tained by the user's shell.
152
154 nsupdate reads input from filename or standard input. Each command is
155 supplied on exactly one line of input. Some commands are for adminis‐
156 trative purposes; others are either update instructions or prerequisite
157 checks on the contents of the zone. These checks set conditions that
158 some name or set of resource records (RRset) either exists or is absent
159 from the zone. These conditions must be met if the entire update re‐
160 quest is to succeed. Updates are rejected if the tests for the prereq‐
161 uisite conditions fail.
162
163 Every update request consists of zero or more prerequisites and zero or
164 more updates. This allows a suitably authenticated update request to
165 proceed if some specified resource records are either present or miss‐
166 ing from the zone. A blank input line (or the send command) causes the
167 accumulated commands to be sent as one Dynamic DNS update request to
168 the name server.
169
170 The command formats and their meanings are as follows:
171
172 server servername port
173 This command sends all dynamic update requests to the name
174 server servername. When no server statement is provided, nsup‐
175 date sends updates to the primary server of the correct zone.
176 The MNAME field of that zone's SOA record identify the primary
177 server for that zone. port is the port number on servername
178 where the dynamic update requests are sent. If no port number is
179 specified, the default DNS port number of 53 is used.
180
181 NOTE:
182 This command has no effect when GSS-TSIG is in use.
183
184 local address port
185 This command sends all dynamic update requests using the local
186 address. When no local statement is provided, nsupdate sends up‐
187 dates using an address and port chosen by the system. port can
188 also be used to force requests to come from a specific port. If
189 no port number is specified, the system assigns one.
190
191 zone zonename
192 This command specifies that all updates are to be made to the
193 zone zonename. If no zone statement is provided, nsupdate at‐
194 tempts to determine the correct zone to update based on the rest
195 of the input.
196
197 class classname
198 This command specifies the default class. If no class is speci‐
199 fied, the default class is IN.
200
201 ttl seconds
202 This command specifies the default time-to-live, in seconds, for
203 records to be added. The value none clears the default TTL.
204
205 key hmac:keyname secret
206 This command specifies that all updates are to be TSIG-signed
207 using the keyname-secret pair. If hmac is specified, it sets the
208 signing algorithm in use. The default is hmac-md5; if MD5 was
209 disabled, the default is hmac-sha256. The key command overrides
210 any key specified on the command line via -y or -k.
211
212 gsstsig
213 This command uses GSS-TSIG to sign the updates. This is equiva‐
214 lent to specifying -g on the command line.
215
216 oldgsstsig
217 This command uses the Windows 2000 version of GSS-TSIG to sign
218 the updates. This is equivalent to specifying -o on the command
219 line.
220
221 realm [realm_name]
222 When using GSS-TSIG, this command specifies the use of
223 realm_name rather than the default realm in krb5.conf. If no
224 realm is specified, the saved realm is cleared.
225
226 check-names [boolean]
227 This command turns on or off check-names processing on records
228 to be added. Check-names has no effect on prerequisites or
229 records to be deleted. By default check-names processing is on.
230 If check-names processing fails, the record is not added to the
231 UPDATE message.
232
233 prereq nxdomain domain-name
234 This command requires that no resource record of any type exist
235 with the name domain-name.
236
237 prereq yxdomain domain-name
238 This command requires that domain-name exist (as at least one
239 resource record, of any type).
240
241 prereq nxrrset domain-name class type
242 This command requires that no resource record exist of the spec‐
243 ified type, class, and domain-name. If class is omitted, IN (In‐
244 ternet) is assumed.
245
246 prereq yxrrset domain-name class type
247 This command requires that a resource record of the specified
248 type, class and domain-name exist. If class is omitted, IN (in‐
249 ternet) is assumed.
250
251 prereq yxrrset domain-name class type data
252 With this command, the data from each set of prerequisites of
253 this form sharing a common type, class, and domain-name are com‐
254 bined to form a set of RRs. This set of RRs must exactly match
255 the set of RRs existing in the zone at the given type, class,
256 and domain-name. The data are written in the standard text rep‐
257 resentation of the resource record's RDATA.
258
259 update delete domain-name ttl class type data
260 This command deletes any resource records named domain-name. If
261 type and data are provided, only matching resource records are
262 removed. The Internet class is assumed if class is not sup‐
263 plied. The ttl is ignored, and is only allowed for compatibil‐
264 ity.
265
266 update add domain-name ttl class type data
267 This command adds a new resource record with the specified ttl,
268 class, and data.
269
270 show This command displays the current message, containing all of the
271 prerequisites and updates specified since the last send.
272
273 send This command sends the current message. This is equivalent to
274 entering a blank line.
275
276 answer This command displays the answer.
277
278 debug This command turns on debugging.
279
280 version
281 This command prints the version number.
282
283 help This command prints a list of commands.
284
285 Lines beginning with a semicolon (;) are comments and are ignored.
286
288 The examples below show how nsupdate can be used to insert and delete
289 resource records from the example.com zone. Notice that the input in
290 each example contains a trailing blank line, so that a group of com‐
291 mands is sent as one dynamic update request to the primary name server
292 for example.com.
293
294 # nsupdate
295 > update delete oldhost.example.com A
296 > update add newhost.example.com 86400 A 172.16.1.1
297 > send
298
299 Any A records for oldhost.example.com are deleted, and an A record for
300 newhost.example.com with IP address 172.16.1.1 is added. The newly
301 added record has a TTL of 1 day (86400 seconds).
302
303 # nsupdate
304 > prereq nxdomain nickname.example.com
305 > update add nickname.example.com 86400 CNAME somehost.example.com
306 > send
307
308 The prerequisite condition tells the name server to verify that there
309 are no resource records of any type for nickname.example.com. If there
310 are, the update request fails. If this name does not exist, a CNAME for
311 it is added. This ensures that when the CNAME is added, it cannot con‐
312 flict with the long-standing rule in RFC 1034 that a name must not ex‐
313 ist as any other record type if it exists as a CNAME. (The rule has
314 been updated for DNSSEC in RFC 2535 to allow CNAMEs to have RRSIG,
315 DNSKEY, and NSEC records.)
316
318 /etc/resolv.conf
319 Used to identify the default name server
320
321 /run/session.key
322 Sets the default TSIG key for use in local-only mode
323
324 K{name}.+157.+{random}.key
325 Base-64 encoding of the HMAC-MD5 key created by dnssec-keygen.
326
327 K{name}.+157.+{random}.private
328 Base-64 encoding of the HMAC-MD5 key created by dnssec-keygen.
329
331 RFC 2136, RFC 3007, RFC 2104, RFC 2845, RFC 1034, RFC 2535, RFC 2931,
332 named(8), dnssec-keygen(8), tsig-keygen(8).
333
335 The TSIG key is redundantly stored in two separate files. This is a
336 consequence of nsupdate using the DST library for its cryptographic op‐
337 erations, and may change in future releases.
338
340 Internet Systems Consortium
341
343 2023, Internet Systems Consortium
344
345
346
347
3489.18.20 NSUPDATE(1)