freens

freens is a configuration tool I wrote for bind, it changes lists of simple
host -> address pairs to bind configuration files.  Actually I wrote it twice,
first in C and I lost that version, now in brace.


for example if you have a file /freens/nipl.net:

mx1	.
ns1	.
.	pi
pi	216.218.223.118
galactus	75.119.217.98
ftp.galactus	galactus
www	.
mail	.
sam	.
nika	.
james	.
play	.
ham	.
spam	.


It will generate /etc/bind/freens/nipl.net:

$TTL	60	; 1 minute
@		IN	SOA	ns1.nipl.net. root.nipl.net. (
				1239943724	; Serial
				3600		; Refresh	 1 hour
				1200		; Retry		20 minutes
				2419200		; Expire	 4 weeks
				300 )		; -ve Cache TTL	 5 min

mx1	IN	A	216.218.223.118
ns1	IN	A	216.218.223.118
nipl.net.	IN	A	216.218.223.118
nipl.net.	MX	10	mx1
nipl.net.	IN	NS	ns1
pi	IN	A	216.218.223.118
galactus	IN	A	75.119.217.98
ftp.galactus.	IN	CNAME	galactus
www	IN	CNAME	nipl.net.
mail	IN	CNAME	nipl.net.
sam	IN	CNAME	nipl.net.
nika	IN	CNAME	nipl.net.
james	IN	CNAME	nipl.net.
play	IN	CNAME	nipl.net.
ham	IN	CNAME	nipl.net.
spam	IN	CNAME	nipl.net.


To conform with DNS guidelines it tries to resolve the main domain, any
multi-addres domain, any nameserver or mail server records to A or AAAA
records.  See the "mx1" host above for example.  Other aliases become CNAME
records.

It adds the required entries to /etc/bind/named.conf.freens:

zone "nipl.net" {
	type master;
	file "/etc/bind/freens/nipl.net";
};


And it generates zone files for reverse dns, for IP4 and IP6, for example
/etc/bind/freens/118.223.218.216.in-addr.arpa

$TTL	60	; 1 minute
@		IN	SOA	ns1.nipl.net. root.nipl.net. (
				1239943724	; Serial
				3600		; Refresh	 1 hour
				1200		; Retry		20 minutes
				2419200		; Expire	 4 weeks
				300 )		; -ve Cache TTL	 5 min

118.223.218.216.in-addr.arpa.	IN	PTR	pi
@	NS	ns1.nipl.net.
@	MX	10	mx1.nipl.net.


It automatically adds NS and MX records for hosts called ns1 and mx2 for
example.  And if your zone has no main-domain entry, or no NS records, or no MX
records, it can add default servers automatically.


There was also a feature to comment out addresses that are not pingable from
multi-address hosts, to provide failover, but it is disabled at the moment.


So in summary, it can be much easier to use freens than to update your bind
configuration manually.

