How to use an input file for nsupdate
The example below shows how to have nsupdate read
subcommands from a file for BIND 9.
- Create a z/OS® UNIX file containing the following nsupdate subcommands.
Assume the file is named nsupdate.commands.
update delete oldhost.example.com A update add newhost.example.com 86400 A 172.16.1.1 show send quit
- Then issue the following command from the directory where the
file, nsupdate.commands resides.
nsupdate nsupdate.commands
- Because the
zone
andserver
subcommands were not explicitly issued, the defaults will come from the resolver configuration data set. Assume the following information is coded in the resolver configuration data set.domain example.com nameserver 127.0.0.1
- The name server on the local host would be used to look up the
location of the
example.com
domain. Once the authoritative name server is located, the updates in the nsupdate.commands file are executed and sent to that name server. - The output is sent to stdout. The following information might
appear on the z/OS UNIX screen.
> nsupdate nsupdate.commands Running nsupdate version 9 Allocated socket 6, type udp Outgoing update query: ;; ->>HEADER<<- opcode: UPDATE, status: NOERROR, id: 0 ;; flags: ; ZONE: 0, PREREQ: 0, UPDATE: 0, ADDITIONAL: 0 ;; UPDATE SECTION: oldhost.example.com. 0 ANY A newhost.example.com. 86400 IN A 172.16.1.1