X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=config%2Fmake-named.pl;h=94b8959f67b2cd8918777bb3d6ea4ed13dd10f4a;hb=06895ae11dbe8dc43dae53e128c122b149decf5f;hp=58eef853a97b292b030e4bb5bd33eadebc29723b;hpb=1c950ce4097208824ee3de0cba89771f339b41d1;p=nms diff --git a/config/make-named.pl b/config/make-named.pl index 58eef85..94b8959 100755 --- a/config/make-named.pl +++ b/config/make-named.pl @@ -1,22 +1,24 @@ #! /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.pl at $date. Do not edit manually! options { directory "/etc/bind"; @@ -25,8 +27,8 @@ options { 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,60 +39,45 @@ zone "0.0.127.in-addr.arpa" { notify no; }; -zone "tg06.gathering.org" { +zone "tg07.gathering.org" { type master; - file "tg06.gathering.org"; - notify yes; - allow-transfer { 194.0.255.2; }; -}; -zone "www.gathering.org" { - type master; - file "www.gathering.org"; + file "tg07.gathering.org"; notify yes; allow-transfer { 194.0.255.2; }; }; // serversubnett -zone "255.0.194.in-addr.arpa" { +zone "255.76.87.in-addr.arpa" { type master; - file "254.0.194.in-addr.arpa"; + file "255.76.87.in-addr.arpa"; notify yes; allow-transfer { 194.0.255.2; 193.0.0.0/22; }; }; -zone "0.194.in-addr.arpa" { +zone "76.87.in-addr.arpa" { type master; allow-update { key DHCP_UPDATER; }; notify yes; - file "dynamic/0.194.in-addr.arpa"; + file "dynamic/76.87.in-addr.arpa"; allow-transfer { 194.19.3.20; 194.0.255.2; 193.0.0.0/22; }; }; key DHCP_UPDATER { algorithm HMAC-MD5.SIG-ALG.REG.INT; - secret 5Yz1azvh7mE0IRGffTvtKg==; + secret F388UOhaIIKHRH9TDE5PTA==; }; 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 $domain = $net->{name}; + print <<"EOF"; +zone "$domain.tg07.gathering.org" { type master; allow-update { key DHCP_UPDATER; }; notify yes; - file "dynamic/$d.tg06.gathering.org"; + file "dynamic/$domain.tg07.gathering.org"; allow-transfer { 194.19.3.20; 194.0.255.2; }; }; EOF - } }