Index: dns/rev2revzone.pl
===================================================================
--- dns/rev2revzone.pl	(revision 3124)
+++ dns/rev2revzone.pl	(revision 3124)
@@ -0,0 +1,41 @@
+#!/usr/bin/perl
+
+open STDIN,shift @ARGV
+        or die "Cannot open $_:$!" 
+                if @ARGV;
+
+while(<STDIN>) {
+	chomp;
+	die "Malformed"
+		unless m/^(\d+)\.(\d+)\.(\d+).(\d+)\s+([\w\-\.]+)$/i;
+	my ($a,$b,$c,$d,$host) = ($1,$2,$3,$4,$5);
+
+	push @{ $zone{ $a.'.'.$b } }, "$c.$d\tIN PTR\t$host\t; $a.$b.$c.$d";
+};
+
+foreach $z (sort keys %zone) {
+
+	print <<"ZONE";
+\$ORIGIN $z.in-addr.arpa.
+\$TTL 86400
+@       1D IN 	SOA       ns1.wLeiden.NET. hostmaster.wLeiden.NET. (
+		$SOA; serial (d. adams)
+                3H              ; refresh
+                15M             ; retry
+                1W              ; expiry
+                1D )            ; minimum
+	IN NS   ns1.wLeiden.NET.
+	IN NS   ns2.wLeiden.NET.
+	IN NS   ns3.wLeiden.NET.
+	IN NS   ns4.wLeiden.NET.
+
+ns1             IN      A       172.18.8.66    ;tango
+ns2             IN      A       172.17.8.68    ;proxy1
+ns3             IN      A       172.17.143.4   ;proxy2
+ns4             IN      A       172.20.128.98  ;proxy4
+ZONE
+
+	foreach $l (@{$zone{$z}}) {
+		print "$l\n";
+	};	
+};
Index: dns/zone2rev.pl
===================================================================
--- dns/zone2rev.pl	(revision 3124)
+++ dns/zone2rev.pl	(revision 3124)
@@ -0,0 +1,40 @@
+#!/usr/bin/perl
+#
+open STDIN,shift @ARGV
+	or die "Cannot open $_:$!" 
+		if @ARGV;
+
+$domain = '.';
+
+while(<STDIN>) {
+
+	if (m/\$ORIGIN\s+([\w\-\.]+)/) {
+		$domain = lc $1;
+		next;
+	};
+	next 
+		unless m/^\s*([\w\-\.]+)\s+(IN\s+)?A\s+([\d\.]+)/i;
+
+	my ($host,$ip) = (lc $1,lc $3);
+
+	$host .= '.'.$domain 
+		unless $host =~ m/\.$/;
+
+	warn "A-Resourcce Duplicated\n\tfor $ip/$host at line $.\n"
+		if defined $host{$ip} and $host{$ip} eq $host;
+
+	warn "A-Resourcce Conflict\n\t$ip used for $host and $host{$ip} at line $.\n"
+		if defined $host{$ip};
+
+	warn "Resource reuse\n\t$host at $ip{$host}/$ip at line $.\n"
+		if defined $ip{$host} and $ip eq $ip{$host};
+
+	warn "Resourcce mismatch\n\t$host at $ip{$host} and $ip at line $.\n"
+		if defined $ip{$host};
+
+	$host{$ip} = $host;
+	$ip{$host} = $ip;
+
+	print "$ip\t$host\n";
+};
+
