]> git.sesse.net Git - nms/blobdiff - config/make-named.pl
Un-hijack.
[nms] / config / make-named.pl
index 5f999ab44cf523174841e87236ec1c358ec8fa82..2fb295b472763890198b6c316b94b40c5db092ac 100755 (executable)
@@ -4,19 +4,18 @@ use strict;
 my $date = `date --rfc-2822`;
 chomp $date;
 
-# les inn nettnavn
-my %netnames = ();
-my %netmasks = ();
 my @nets = ();
 open NAMES, "switches.txt"
-or die "switches.txt: $!";
+       or die "switches.txt: $!";
 while (<NAMES>) {
        chomp;
-       /194\.0\.(\d+\.\d+)\s+(\d+)\s+(\S+)/ or next;
-       $netmasks{$1} = $2;
-       $netnames{$1} = $3;
-       push @nets, $1;
-}
+       /87\.76\.(\d+\.\d+)\s+(\d+)\s+(\S+)/ or next;
+       push @nets, {
+               net => $1,
+               netmask => $2,
+               name => $3
+       };
+}      
 
 print <<"EOF";
 // Autogenerated by make-named.pl at $date. Do not edit manually! 
@@ -24,7 +23,7 @@ print <<"EOF";
 options {
         directory "/etc/bind";
        allow-query { any; };
-       allow-transfer { 194.19.3.20; 194.0.255.2; }; 
+       allow-transfer { 194.19.3.20; 87.76.255.2; }; 
        auth-nxdomain no;
        recursion yes;
 
@@ -44,15 +43,58 @@ zone "tg07.gathering.org" {
        type master;
        file "tg07.gathering.org";
        notify yes;
-       allow-transfer { 194.0.255.2; };
+       allow-transfer { 87.76.255.2; };
+};
+
+// hijack
+zone "sth.ip-performance.se" {
+       type master;
+       file "sth.ip-performance.se";
+       notify yes;
+       allow-transfer { 87.76.255.2; };
+};
+
+// linknett
+zone "0.76.87.in-addr.arpa" {
+       type master;
+       file "0.76.87.in-addr.arpa";
+       notify yes;
+       allow-transfer { 87.76.255.2; 193.0.0.0/22; };
+};
+
+// linknett
+zone "174.76.87.in-addr.arpa" {
+       type master;
+       file "174.76.87.in-addr.arpa";
+       notify yes;
+       allow-transfer { 87.76.255.2; 193.0.0.0/22; };
+};
+
+// net-subnett
+zone "239.76.87.in-addr.arpa" {
+       type master;
+       file "239.76.87.in-addr.arpa";
+       notify yes;
+       allow-transfer { 87.76.255.2; 193.0.0.0/22; };
 };
 
 // serversubnett
+zone "254.76.87.in-addr.arpa" {
+       type master;
+       file "254.76.87.in-addr.arpa";
+       notify yes;
+       allow-transfer { 87.76.255.2; 193.0.0.0/22; };
+};
 zone "255.76.87.in-addr.arpa" {
        type master;
        file "255.76.87.in-addr.arpa";
        notify yes;
-       allow-transfer { 194.0.255.2; 193.0.0.0/22; };
+       allow-transfer { 87.76.255.2; 193.0.0.0/22; };
+};
+
+key DHCP_UPDATER {
+       algorithm HMAC-MD5.SIG-ALG.REG.INT;
+       secret F388UOhaIIKHRH9TDE5PTA==;
 };
 
 zone "76.87.in-addr.arpa" {
@@ -60,34 +102,27 @@ zone "76.87.in-addr.arpa" {
        allow-update { key DHCP_UPDATER; };
        notify yes;
        file "dynamic/76.87.in-addr.arpa";      
-       allow-transfer { 194.19.3.20; 194.0.255.2; 193.0.0.0/22; };
+       allow-transfer { 194.19.3.20; 87.76.255.2; 193.0.0.0/22; };
 };
-
-key DHCP_UPDATER {
-       algorithm HMAC-MD5.SIG-ALG.REG.INT;
-       secret F388UOhaIIKHRH9TDE5PTA==;
+zone "f.f.f.f.8.d.6.1.1.0.0.2.ip6.arpa" {
+       type master;
+       allow-update { key DHCP_UPDATER; };
+       notify yes;
+       file "dynamic/f.f.f.f.8.d.6.1.1.0.0.2.ip6.arpa";        
+       allow-transfer { 194.19.3.20; 87.76.255.2; };
 };
 
 EOF
 
 for my $net (@nets) {
-       my $domain = $netnames{$net};
-       my @domains;
-       if ($domain =~ /^split:(.*)/) {
-               @domains = split /,/, $1;
-       } else {
-               @domains = ($domain);
-       }
-
-       for my $d (@domains) {
-               print <<"EOF";
-zone "$d.tg07.gathering.org" {
+       my $domain = $net->{name};
+       print <<"EOF";
+zone "$domain.tg07.gathering.org" {
        type master;
        allow-update { key DHCP_UPDATER; };
        notify yes;
-       file "dynamic/$d.tg07.gathering.org";
-       allow-transfer { 194.19.3.20; 194.0.255.2; };
+       file "dynamic/$domain.tg07.gathering.org";
+       allow-transfer { 194.19.3.20; 87.76.255.2; };
 };
 EOF
-       }
 }