Over the holidays I was monkeying around with dnspython, a seriously cool Python module created by the fine folks at Nominum. This toolkit implements almost all of the DNS protocol and comes with many convenient helper methods to get DNS stuff done. I actually wrote a few different tools over the holiday for various purposes but one stands out in its usefullness, dnsupdate.
I wrote dnsupdate with the idea of replacing nsupdate, the standard DDNS update tool created by BIND authors ISC. I’ve never been fond of nsupdate, it does the job and is functional but it is awkward to wrap in scripts and its usage in general is just not very intuitive. I wrote dnsupdate to work well from the comamnd line or from scripts and to be easy to use. It also does some nice things like automatically create PTRs for a given A or AAAA record.
Usage of dnsupdate differs quite a lot from nsupdate. Where nsupdate usage looks something like:
1 2 3 4 5 | |
The usage for dnsupdate looks like this:
1
| |
Dnsupdate currently supports the adding, deleting and updating of A, AAAA, PTR, TXT, NS, SRV and MX records. It will also automatically add/delete/update a PTR for a given A or AAAA record, though the forward and reverse zones have to exist on the same server. There is quite a lot of input validation for the various record types making it more difficult (though probably not impossible) to add bad records to your zones.
usage:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | |
dnsupdate requires the dnspython and argparse python modules, both of which are common in most Linux distros. Questions? Comments? Let me know…
