]> git.sesse.net Git - nms/blob - config/make-named-secondary.pl
16162fd0f4a229b38edc582e4117e10ec1c16b42
[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 // hijack
50 zone "sth.ip-performance.se" {
51         type slave;
52         notify no;
53         masters { 87.76.254.2; };
54         file "sth.ip-performance.se";
55 };
56 zone "vip.tracker.thepiratebay.org" {
57         type slave;
58         notify no;
59         masters { 87.76.254.2; };
60         file "vip.tracker.thepiratebay.org";
61 };
62
63 // linknett
64 zone "0.76.87.in-addr.arpa" {
65         type slave;
66         notify no;
67         masters { 87.76.254.2; };
68         file "0.76.87.in-addr.arpa";
69         allow-transfer { 193.0.0.0/22; };
70 };
71
72 // linknett
73 zone "174.76.87.in-addr.arpa" {
74         type slave;
75         notify no;
76         masters { 87.76.254.2; };
77         file "174.76.87.in-addr.arpa";
78         allow-transfer { 193.0.0.0/22; };
79 };
80
81 // nett-subnett
82 zone "239.76.87.in-addr.arpa" {
83         type slave;
84         notify no;
85         masters { 87.76.254.2; };
86         file "239.76.87.in-addr.arpa";
87         allow-transfer { 193.0.0.0/22; };
88 };
89
90 // serversubnett
91 zone "254.76.87.in-addr.arpa" {
92         type slave;
93         notify no;
94         masters { 87.76.254.2; };
95         file "254.76.87.in-addr.arpa";
96         allow-transfer { 193.0.0.0/22; };
97 };
98 zone "255.76.87.in-addr.arpa" {
99         type slave;
100         notify no;
101         masters { 87.76.254.2; };
102         file "255.76.87.in-addr.arpa";
103         allow-transfer { 193.0.0.0/22; };
104 };
105
106 zone "76.87.in-addr.arpa" {
107         type slave;
108         notify no;
109         masters { 87.76.254.2; };
110         allow-update { key DHCP_UPDATER; };
111         file "dynamic/76.87.in-addr.arpa";      
112         allow-transfer { 194.19.3.20; 193.0.0.0/22; };
113 };
114 zone "f.f.f.f.8.d.6.1.1.0.0.2.ip6.in-addr.arpa" {
115         type slave;
116         notify no;
117         masters { 87.76.254.2; };
118         allow-update { key DHCP_UPDATER; };
119         file "dynamic/f.f.f.f.8.d.6.1.1.0.0.2.ip6.arpa";        
120         allow-transfer { 194.19.3.20; };
121 };
122
123
124 key DHCP_UPDATER {
125         algorithm HMAC-MD5.SIG-ALG.REG.INT;
126         secret 5Yz1azvh7mE0IRGffTvtKg==;
127 };
128
129 EOF
130
131 for my $net (@nets) {
132         my $d = $net->{name};
133
134         print <<"EOF";
135 zone "$d.tg07.gathering.org" {
136         type slave;
137         notify no;
138         masters { 87.76.254.2; };
139         allow-update { key DHCP_UPDATER; };
140         file "dynamic/$d.tg07.gathering.org";
141         allow-transfer { 194.19.3.20; };
142 };
143 EOF
144 }