]> git.sesse.net Git - nms/blob - config/make-named-secondary.pl
Add 174 as a static net.
[nms] / config / make-named-secondary.pl
1 #! /usr/bin/perl -w
2 use strict;
3
4 my $date = `date --rfc-2822`;
5 chomp $date;
6
7 my @nets = ();
8 open NAMES, "switches.txt"
9         or die "switches.txt: $!";
10 while (<NAMES>) {
11         chomp;
12         /87\.76\.(\d+\.\d+)\s+(\d+)\s+(\S+)/ or next;
13         push @nets, {
14                 net => $1,
15                 netmask => $2,
16                 name => $3
17         };
18 }       
19
20 print <<"EOF";
21 // Autogenerated by make-named-secondary.pl at $date. Do not edit manually! 
22
23 options {
24         directory "/etc/bind";
25         allow-query { any; };
26         allow-transfer { 194.19.3.20; }; 
27         auth-nxdomain no;
28         recursion yes;
29
30 //      forwarders { 194.19.2.11; 194.19.3.11; }; 
31 //      forward only;
32 };
33
34 zone "." { type hint; file "db.root"; };
35
36 zone "0.0.127.in-addr.arpa" {
37         type master;
38         file "0.0.127.in-addr.arpa";
39         notify no;
40 };
41
42 zone "tg07.gathering.org" {
43         type slave;
44         notify no;
45         masters { 87.76.254.2; };
46         file "tg07.gathering.org";
47 };
48
49 // linknett
50 zone "174.76.87.in-addr.arpa" {
51         type slave;
52         notify no;
53         masters { 87.76.254.2; };
54         file "174.76.87.in-addr.arpa";
55         allow-transfer { 193.0.0.0/22; };
56 };
57
58 // nett-subnett
59 zone "239.76.87.in-addr.arpa" {
60         type slave;
61         notify no;
62         masters { 87.76.254.2; };
63         file "239.76.87.in-addr.arpa";
64         allow-transfer { 193.0.0.0/22; };
65 };
66
67 // serversubnett
68 zone "254.76.87.in-addr.arpa" {
69         type slave;
70         notify no;
71         masters { 87.76.254.2; };
72         file "254.76.87.in-addr.arpa";
73         allow-transfer { 193.0.0.0/22; };
74 };
75 zone "255.76.87.in-addr.arpa" {
76         type slave;
77         notify no;
78         masters { 87.76.254.2; };
79         file "255.76.87.in-addr.arpa";
80         allow-transfer { 193.0.0.0/22; };
81 };
82
83 zone "76.87.in-addr.arpa" {
84         type slave;
85         notify no;
86         masters { 87.76.254.2; };
87         allow-update { key DHCP_UPDATER; };
88         file "dynamic/76.87.in-addr.arpa";      
89         allow-transfer { 194.19.3.20; 193.0.0.0/22; };
90 };
91
92 key DHCP_UPDATER {
93         algorithm HMAC-MD5.SIG-ALG.REG.INT;
94         secret 5Yz1azvh7mE0IRGffTvtKg==;
95 };
96
97 EOF
98
99 for my $net (@nets) {
100         my $d = $net->{name};
101
102         print <<"EOF";
103 zone "$d.tg07.gathering.org" {
104         type slave;
105         notify no;
106         masters { 87.76.254.2; };
107         allow-update { key DHCP_UPDATER; };
108         file "dynamic/$d.tg07.gathering.org";
109         allow-transfer { 194.19.3.20; };
110 };
111 EOF
112 }