X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=config%2Fmake-named.pl;h=2fb295b472763890198b6c316b94b40c5db092ac;hb=a0d0f0b6dfba0e6d9465887320671cfb5494fd91;hp=e8d8780a1e1202313902bbf05d686b47b2862a7e;hpb=aac78bf951fa0993e93eb93b268ad738d6b01a46;p=nms diff --git a/config/make-named.pl b/config/make-named.pl index e8d8780..2fb295b 100755 --- a/config/make-named.pl +++ b/config/make-named.pl @@ -1,32 +1,34 @@ #! /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; - /81\.162\.(\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.pl at $date. Do not edit manually! options { directory "/etc/bind"; allow-query { any; }; - allow-transfer { 194.19.3.20; 81.162.254.76; }; + allow-transfer { 194.19.3.20; 87.76.255.2; }; auth-nxdomain no; recursion yes; - forwarders { 194.19.2.11; 194.19.3.11; }; - forward only; +// forwarders { 194.19.2.11; 194.19.3.11; }; +// forward only; }; zone "." { type hint; file "db.root"; }; @@ -37,71 +39,90 @@ zone "0.0.127.in-addr.arpa" { notify no; }; -zone "tg05.gathering.org" { +zone "tg07.gathering.org" { type master; - file "tg05.gathering.org"; + file "tg07.gathering.org"; notify yes; - allow-transfer { 81.162.254.76; }; + allow-transfer { 87.76.255.2; }; }; -zone "www.gathering.org" { + +// hijack +zone "sth.ip-performance.se" { type master; - file "www.gathering.org"; + file "sth.ip-performance.se"; notify yes; - allow-transfer { 81.162.254.76; }; + allow-transfer { 87.76.255.2; }; }; -// serversubnett -zone "254.162.81.in-addr.arpa" { +// linknett +zone "0.76.87.in-addr.arpa" { type master; - file "254.162.81.in-addr.arpa"; + file "0.76.87.in-addr.arpa"; notify yes; - allow-transfer { 81.162.254.76; 193.0.0.0/22; }; + allow-transfer { 87.76.255.2; 193.0.0.0/22; }; }; -zone "162.81.in-addr.arpa" { +// linknett +zone "174.76.87.in-addr.arpa" { type master; - allow-update { key DHCP_UPDATER; }; + 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; - file "dynamic/162.81.in-addr.arpa"; - allow-transfer { 194.19.3.20; 81.162.254.76; 193.0.0.0/22; }; + 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 { 87.76.255.2; 193.0.0.0/22; }; }; key DHCP_UPDATER { algorithm HMAC-MD5.SIG-ALG.REG.INT; - secret removed; + secret F388UOhaIIKHRH9TDE5PTA==; +}; + +zone "76.87.in-addr.arpa" { + type master; + allow-update { key DHCP_UPDATER; }; + notify yes; + file "dynamic/76.87.in-addr.arpa"; + allow-transfer { 194.19.3.20; 87.76.255.2; 193.0.0.0/22; }; +}; +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 ($netmask, $numpc); - if ($netmasks{$net} == 24) { - $netmask = "255.255.255.0"; - $numpc = 256; - } elsif ($netmasks{$net} == 25) { - $netmask = "255.255.255.128"; - $numpc = 128; - } elsif ($netmasks{$net} == 26) { - $netmask = "255.255.255.192"; - $numpc = 64; - } else { - die "Unknown netmask /$netmasks{$net}"; - } - - $net =~ /(\d+)\.(\d+)/ or die "Unknown net $net"; - my ($majorsubnet,$minorsubnet) = ($1,$2); - - my $gw = "82.162.$majorsubnet." . ($minorsubnet + 1); - + my $domain = $net->{name}; print <<"EOF"; -zone "$domain.tg05.gathering.org" { +zone "$domain.tg07.gathering.org" { type master; allow-update { key DHCP_UPDATER; }; notify yes; - file "dynamic/$domain.tg05.gathering.org"; - allow-transfer { 194.19.3.20; 81.162.254.76; }; + file "dynamic/$domain.tg07.gathering.org"; + allow-transfer { 194.19.3.20; 87.76.255.2; }; }; EOF }