#! /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 (<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. 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;
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;
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
- }
}