3 # Copyright (C) 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
5 # Permission to use, copy, modify, and/or distribute this software for any
6 # purpose with or without fee is hereby granted, provided that the above
7 # copyright notice and this permission notice appear in all copies.
9 # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10 # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11 # AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12 # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13 # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15 # PERFORMANCE OF THIS SOFTWARE.
17 # Id: setup.sh,v 1.4 2011/09/02 21:15:35 each Exp
20 echo "Usage: $0 [-s] <number of zones> [<records per zone>]"
21 echo " -s: use the same zone file all zones"
25 if [ "$#" -lt 1 -o "$#" -gt 3 ]; then
30 if [ $1 = "-s" ]; then
39 [ "$#" -eq 1 ] && nrecords
=$1
46 listen-on { localhost; };
47 listen-on-v6 { localhost; };
50 allow-transfer { localhost; };
51 allow-recursion { none; };
56 secret "1234abcd8765";
61 inet 127.0.0.1 port 9953 allow { any; } keys { rndc_key; };
66 file "`pwd`/named.log" versions 3 size 100m;
79 $PERL makenames.pl
$nzones |
while read zonename
; do
80 if [ $single_file ]; then
81 echo "zone $zonename { type master; file \"smallzone.db\"; };"
83 [ -d zones
] || mkdir zones
84 $PERL mkzonefile.pl
$zonename $nrecords > zones
/$zonename.db
85 echo "zone $zonename { type master; file \"zones/$zonename.db\"; };"