Thursday 14 January 2010

Bind Dynamic DNS Updates

I saw a request to update Bind via a command line rather than Webmin for the ease and speed of a command line; So I embarked on investigating this.

Firstly it seems that there is not a lot of dynamic update or command line update scripts available or the people just don't want to share ???

I stumbled across nsupdate, an application that is part of the Bind suite.
This is a command line tool to add dynamic updates to an DNS server.

for this to work you need to update the specific zone file with at least the following configuration:

zone "example.com" {
type master;
file "/etc/bind/example.com.hosts";
allow-update {192.168.0.0/24; };
journal "/var/lib/bind/example.com.hosts.jnl";

};
For dynamic DNS you need:
allow-update
journal

then to add an entry to the DNS server:
from within the 192.168 ip range :

user@pc:~$ nsupdate
> zone example.com
> update add guest1.example.com. 86400 A 192.168.0.10
> send
> quit

your syslog on your DNS server will log all updates

No comments:

Post a Comment