A simple preprocessor for zone files written in awk. Creates forward and reverse zones from one single file.
Some DNS zones are rather boring: just A records for each machine/interface and its PTR records in the reverse zone. No other resource type. Just a list of all devices in your network which is edited frequently. Over time the large number of quite similar lines becomes more and more unreadable. And you make mistakes: forward and reverse zones get out of sync or you forget about some interfaces.
Lazyzone allows you to write your zone in a more compact form with less typing and fewer chances for mistakes. It's far from a perfect solution, but it fits my own needs!
Input is just a simple two-column text-file:
[eth0.]server 10.0.0.1
fc0.server 192.168.0.1
desktop 10.0.0.100-200
Put parts of the name in square brackets to create an additional CNAME of the shorter name outside brackets to the full name given.
If the last octet of the address consists of a range, multiple records are created. Each record's name is appended the increasing value of a counter.
(supply each via: -v key=value)
domainvalue for$ORIGINttldefault$TTL-value for zone (append unit, e.g.1d)dns_serverwhich dns-server is authorative for this zonemailmailbox of dns-adminserialserial-number for SOA recordrefreshslave refresh afterrefreshsecondsretrytime between retries of the slaveexpireslave won't answer authoritatively if not reaching the master withinexpiresecondsminimum_ttlnegative caching timereverse_prefixif set a reverse-zone will be generated containing all ips of the supplied prefix
Make sure that mawk or gawk is installed, then run:
sudo make install
If you need a Debian package, run:
make deb
sudo apt-get install debian/lazyzone-*.deb
That package is also available for download through Github Releases.
This software is licensed under GPLv3.