Stapler
Stapler is a Perl application developed to simplify server DNS zone file maintenance.
Every time I added a server to my network, I had to change the zone files for all of the domains in which that server would be used. If it was a web or e-mail server, I might have a dozen zone files to edit. If I changed IP addressing schemes, I had to edit all the zone files. And half the time or more I would forget to change the serial number in one or more zone files. What a pain.
Stapler makes this all very easy by keeping your primary and secondary domains, machines, aliases (subdomains) and configuration in simple ASCII text files. You can add a new web server and have the zone files for a hundred domains re-written in seconds. Add a new subdomain for a customer and Stapler will re-write the zone files and refresh BIND's cache in the blink of an eye.
To use Stapler you need to be using BIND for DNS resolution (it does not work with things like TinyDNS). You also need Perl with the Term::ANSIColor module, but virtually every Linux distribution is sure to have that by default. To check if you have it, try:
$ locate ANSIColor.pm
You should see something like this (path may be different):
/usr/lib/perl5/5.8.8/Term/ANSIColor.pm
Install Stapler Perl script
Download the script and sample configuration files. The latest version is here:
ftp://gloria.ixo.ca/stapler/stapler-latest.tgz
Paths are preserved in the tar file: the script is placed in /usr/local/bin/ and the configuration files are placed in /etc/stapler/. Use “tar -tzf” to view the file and “tar -xPpzf” to extract it.
Configuration
You will find comments within the configuration files, which include:
- 192.168.1 — a sample of a netblock configuration, you can have as many of these as you like.
- aliases.stapler — machine aliases (a.k.a., sub-domains).
- domain.primary — domains for which this DNS server is authoritative (i.e., the master).
- domain.secondary — domains names for which this DNS server is a relay (i.e., a slave).
- named.root — a copy of the root name servers that is publicly available.
- stapler.conf — the main configuration file.