From 204425369da0a7596ebcfc3646b6e2eb611dfd17 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 1 Apr 2007 17:22:53 +0200 Subject: [PATCH] Update make-named-secondary.pl for TG07. --- config/make-named-secondary.pl | 76 +++++++++++++++++++--------------- 1 file changed, 43 insertions(+), 33 deletions(-) diff --git a/config/make-named-secondary.pl b/config/make-named-secondary.pl index 38fda02..493f7c9 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-secondary.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,29 +39,45 @@ zone "0.0.127.in-addr.arpa" { notify no; }; -zone "tg06.gathering.org" { +zone "tg07.gathering.org" { type slave; notify no; - masters { 194.0.254.2; }; - file "tg06.gathering.org"; + masters { 87.76.254.2; }; + file "tg07.gathering.org"; +}; + +// nett-subnett +zone "239.0.194.in-addr.arpa" { + type slave; + notify no; + masters { 87.76.254.2; }; + file "239.0.194.in-addr.arpa"; + allow-transfer { 193.0.0.0/22; }; }; // serversubnett +zone "254.0.194.in-addr.arpa" { + type slave; + notify no; + masters { 87.76.254.2; }; + file "254.0.194.in-addr.arpa"; + allow-transfer { 193.0.0.0/22; }; +}; zone "255.0.194.in-addr.arpa" { type slave; notify no; - masters { 194.0.254.2; }; + masters { 87.76.254.2; }; file "255.0.194.in-addr.arpa"; - allow-transfer { 194.0.255.2; 193.0.0.0/22; }; + 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; }; + allow-transfer { 194.19.3.20; 193.0.0.0/22; }; }; key DHCP_UPDATER { @@ -70,24 +88,16 @@ key DHCP_UPDATER { EOF for my $net (@nets) { - my $domain = $netnames{$net}; - my @domains; - if ($domain =~ /^split:(.*)/) { - @domains = split /,/, $1; - } else { - @domains = ($domain); - } + my $d = $net->{name}; - for my $d (@domains) { - print <<"EOF"; -zone "$d.tg06.gathering.org" { + 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 - } } -- 2.39.2