Dynamic DNS with bind 9
Interactively add a host
nsupdate
> server bind1.example.com
> zone example.com
> update add blah.example.com 3600 A 10.23.12.99
> send
> zone 12.23.10.in-addr.arpa.
> update add 99.12.23.10.in-addr.arpa. 3600 PTR blah.example.com
> send
> quit
This adds both a forward and reverse entries for the host blah.example.com.
Interactively remove a host
# nsupdate
> server bind1.example.com
> zone example.com
> update delete blah.example.com A
> send
> zone 12.23.10.in-addr.arpa.
> update delete 99.12.23.10.in-addr.arpa. PTR
> send
> quit
This deletes both the forward and reverse entries for the host blah.example.com.
Non-interactive mode
Commands can also be put into a text file which is passed to nsupdate
.
nsupdate /path/to/command_file.txt