|I l@ve RuBoard|
5.20 Dynamically Updating a Zone
The basic command in nsupdate's interactive mode is update. To add a new record, use update add. To delete one or more records, use update delete. update add takes a resource record, including an explicit TTL, as an argument. For example:
> update add host.foo.example. 3600 A 192.168.0.31
To delete a particular record, specify the record as an argument to update delete:
> update delete foo.example. MX 10 mail.foo.example.
> update delete foo.example. MX
Finally, to delete all records of any type attached to a domain name, specify just the domain name as an argument to update delete:
> update delete host.foo.example.
You can perform more than one add or delete operation at once by specifying multiple update commands, each on its own line, as long as the changes are made to a single zone. Once you're ready to send the update, type:
Here's a complete nsupdate session:
$ nsupdate > update delete www.foo.example. IN A > update add www.foo.example. 3600 IN A 192.168.0.89 > send
nsupdate can communicate with (and hence update) any name server. It looks up the SOA record of the zone the domain name in the update belongs in and sends the update to the name server listed in the MNAME field. Consequently, you should make sure the MNAME field of each of your zones' SOA records contains the domain name of the real primary master name server for the zone.
5.20.4 See Also
nsupdate(8); Section 3.11, for how to allow dynamic updates to a zone; Recipes Section 5.21, Section 5.22, and Section 5.23 for variations on sending dynamic updates to a name server; Section 9.10 and Section 9.11, for sending dynamic updates programmatically; and "DNS Dynamic Update" in Chapter 10 of DNS and BIND.
|I l@ve RuBoard|