3 # Copyright (C) 2004, 2007, 2012 Internet Systems Consortium, Inc. ("ISC")
4 # Copyright (C) 2000, 2001 Internet Software Consortium.
6 # Permission to use, copy, modify, and/or distribute this software for any
7 # purpose with or without fee is hereby granted, provided that the above
8 # copyright notice and this permission notice appear in all copies.
10 # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
11 # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12 # AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
13 # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14 # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16 # PERFORMANCE OF THIS SOFTWARE.
18 # Id: setup.pl,v 1.6 2007/06/19 23:47:05 tbox Exp
21 # Set up test data for zone transfer quota tests.
29 make_zones
(3, "10.53.0.2");
30 make_zones
(4, "10.53.0.3");
33 new FileHandle
("ns1/root.db", "w") or die;
35 print $rootdelegations <<END;
37 . IN SOA gson.nominum.com. a.root.servers.nil. (
44 . NS a.root-servers.nil.
45 a.root-servers.nil. A 10.53.0.1
48 for ($z = 0; $z < $n_zones; $z++) {
49 my $zn = sprintf("zone%06d.example", $z);
50 foreach $ns (qw(2 3 4)) {
51 print $rootdelegations "$zn. NS ns$ns.$zn.\n";
52 print $rootdelegations "ns$ns.$zn. A 10.53.0.$ns\n";
55 close $rootdelegations;
58 my ($nsno, $slaved_from) = @_;
59 my $namedconf = new FileHandle
("ns$nsno/zones.conf", "w") or die;
60 for ($z = 0; $z < $n_zones; $z++) {
61 my $zn = sprintf("zone%06d.example", $z);
62 if (defined($slaved_from)) {
63 print $namedconf "zone \"$zn\" { type slave; " .
64 "file \"$zn.bk\"; masters { $slaved_from; }; };\n";
66 print $namedconf "zone \"$zn\" { " .
68 "allow-update { any; }; " .
69 "file \"$zn.db\"; };\n";
71 my $fn = "ns$nsno/$zn.db";
72 my $f = new FileHandle
($fn, "w") or die "open: $fn: $!";
74 \@ IN SOA ns2.$zn. hostmaster 1 300 120 3600 86400
81 MX 10 mail1.isp.example.
82 MX 20 mail2.isp.example.
84 for ($i = 0; $i < $n_names; $i++) {
85 print $f sprintf("name%06d", $i) .