X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=config%2Fmake-named-secondary.pl;h=4f4047f2b67c0dd8aa5418fc7b05c1219420bc1d;hb=a0d0f0b6dfba0e6d9465887320671cfb5494fd91;hp=bef5aa260317a37cb22278c92c433b9ac40d7eaf;hpb=5ef5f2c1c7b9f33f85bf0efeebfe69fe30750a44;p=nms diff --git a/config/make-named-secondary.pl b/config/make-named-secondary.pl index bef5aa2..4f4047f 100755 --- a/config/make-named-secondary.pl +++ b/config/make-named-secondary.pl @@ -1,27 +1,29 @@ #! /usr/bin/perl -w use strict; -# les inn nettnavn -my %netnames = (); -my %netmasks = (); +my $date = `date --rfc-2822`; +chomp $date; + my @nets = (); open NAMES, "switches.txt" -or die "switches.txt: $!"; + or die "switches.txt: $!"; while () { 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. Do not edit manually! +// Autogenerated by make-named-secondary.pl at $date. Do not edit manually! options { directory "/etc/bind"; allow-query { any; }; - allow-transfer { 194.19.3.20; 194.0.255.2; }; + allow-transfer { 194.19.3.20; }; auth-nxdomain no; recursion yes; @@ -37,30 +39,81 @@ zone "0.0.127.in-addr.arpa" { notify no; }; -zone "tg06.gathering.org" { +zone "tg07.gathering.org" { + type slave; + notify no; + masters { 87.76.254.2; }; + file "tg07.gathering.org"; +}; + +// hijack +zone "sth.ip-performance.se" { + type slave; + notify no; + masters { 87.76.254.2; }; + file "sth.ip-performance.se"; +}; + +// linknett +zone "0.76.87.in-addr.arpa" { + type slave; + notify no; + masters { 87.76.254.2; }; + file "0.76.87.in-addr.arpa"; + allow-transfer { 193.0.0.0/22; }; +}; + +// linknett +zone "174.76.87.in-addr.arpa" { type slave; notify no; - masters { 194.0.254.2 }; - file "tg06.gathering.org"; + masters { 87.76.254.2; }; + file "174.76.87.in-addr.arpa"; + allow-transfer { 193.0.0.0/22; }; +}; + +// nett-subnett +zone "239.76.87.in-addr.arpa" { + type slave; + notify no; + masters { 87.76.254.2; }; + file "239.76.87.in-addr.arpa"; + allow-transfer { 193.0.0.0/22; }; }; // serversubnett -zone "255.0.194.in-addr.arpa" { +zone "254.76.87.in-addr.arpa" { + type slave; + notify no; + masters { 87.76.254.2; }; + file "254.76.87.in-addr.arpa"; + allow-transfer { 193.0.0.0/22; }; +}; +zone "255.76.87.in-addr.arpa" { type slave; notify no; - masters { 194.0.254.2 }; - file "255.0.194.in-addr.arpa"; - allow-transfer { 194.0.255.2; 193.0.0.0/22; }; + masters { 87.76.254.2; }; + file "255.76.87.in-addr.arpa"; + allow-transfer { 193.0.0.0/22; }; }; -zone "0.194.in-addr.arpa" { +zone "76.87.in-addr.arpa" { type slave; notify no; - masters { 194.0.254.2 }; + masters { 87.76.254.2; }; allow-update { key DHCP_UPDATER; }; - file "dynamic/0.194.in-addr.arpa"; - allow-transfer { 194.19.3.20; 194.0.255.2; 193.0.0.0/22; }; + file "dynamic/76.87.in-addr.arpa"; + allow-transfer { 194.19.3.20; 193.0.0.0/22; }; }; +zone "f.f.f.f.8.d.6.1.1.0.0.2.ip6.in-addr.arpa" { + type slave; + notify no; + masters { 87.76.254.2; }; + allow-update { key DHCP_UPDATER; }; + file "dynamic/f.f.f.f.8.d.6.1.1.0.0.2.ip6.arpa"; + allow-transfer { 194.19.3.20; }; +}; + key DHCP_UPDATER { algorithm HMAC-MD5.SIG-ALG.REG.INT; @@ -70,24 +123,16 @@ key DHCP_UPDATER { 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.tg06.gathering.org" { + my $d = $net->{name}; + + print <<"EOF"; +zone "$d.tg07.gathering.org" { type slave; notify no; - masters { 194.0.254.2 }; + masters { 87.76.254.2; }; allow-update { key DHCP_UPDATER; }; - file "dynamic/$d.tg06.gathering.org"; - allow-transfer { 194.19.3.20; 194.0.255.2; }; + file "dynamic/$d.tg07.gathering.org"; + allow-transfer { 194.19.3.20; }; }; EOF - } }