Revision [1027]
This is an old revision of mkmockdb made by ChristopherTheodore on 2008-01-16 18:43:24.
- This is a perl script that generates a file that can be filled with 100s - 10,000s of zone's and their resource records (SOA,NS,A,AAAA,MX, and TXT). Its purpose is to give a somewhat realistic idea of the size of a "type master;" or a "type slave;" zone file for a TLD so people can plan accordingly.
#!/usr/bin/perl -w # mkmockdb v1.0 # by Christopher Theodore: Rhodes # This script (**$total_zones=100000** and **$records_per_zone=30**), generated a file that was **2.2gb** in size. # You can use it mock up a zone.db to see what how much space a zone.db might be take up if you are thinking about # running a TLD or setting up a Secondary Master (slave) zone for one. # # For the first run, use the current defaults and take a look at what is being printed into the mock.db and then # change the $total_zones and $records_per_zone # use strict; # Total number of mock zones my $total_zones = 1; # Number of "sets" of sub-domains resource records for each mock zone my $records_per_zone = 1; # mock Resource Record data by type my $domain_record = "ABCDEFGHIJKLMNOPQRSTUVWXYZ.ABCDEFGHIJKLMNOPQRSTUVWXYZ.ABCDEF"; my $A_record = "IN A\t000.000.000.000"; my $NS_record = "IN NS\tns00.ABCDEFGHIJKLMNOPQRSTUVWXYZ.ABCDEFGHIJKLMNOPQRSTUVWXYZ.ABCDEF"; my $AAAA_record = "IN AAAA 0000:0000:0000:0000:0000:0000:0000:0000"; my $MX_record = "IN MX\t10 mail.ABCDEFGHIJKLMNOPQRSTUVWXYZ.ABCDEFGHIJKLMNOPQRSTUVWXYZ.ABCDEF"; my $TXT_record = "IN TXT\t\"###################################################################################################\""; my $SOA_record = "\$TTL 0h\n $domain_record\t IN SOA\t $NS_record hostmaster.$MX_record \( 0000000000 0h 0h 0w 0h \)"; my $file_out = "mock.db"; if (open(OUTFILE, ">$file_out")) { # Loop to generate mock zones for (my $a=0;$a <= $total_zones;$a++) { # Print out a standard Source of Authority for the record - you only need one per zone. print OUTFILE "#\n#ZONE NUMBER: $a \n#\n"; print OUTFILE "$SOA_record \n"; print OUTFILE "\t\t $NS_record \n"; print OUTFILE "\t\t $NS_record \n"; print OUTFILE "\t\t $MX_record \n"; print OUTFILE "\t\t $TXT_record \n"; print OUTFILE "\t\t $A_record \n"; print OUTFILE "\t\t $AAAA_record \n"; # Loop to generate some sets of sub-domains in the resource record of each mock zone for (my $b=0;$b <= $records_per_zone;$b++) { # Print out a common set of resource records print OUTFILE "#\n#RECORD NUMBER: $a \n#\n"; print OUTFILE "$domain_record\t\t $NS_record \n"; print OUTFILE "$domain_record\t\t $NS_record \n"; print OUTFILE "$domain_record\t\t $MX_record \n"; print OUTFILE "$domain_record\t\t $TXT_record \n"; print OUTFILE "$domain_record\t\t $A_record \n"; print OUTFILE "$domain_record\t\t $AAAA_record \n"; } } close(OUTFILE); } else { print "ERROR\: $!\n"; die; }
CategoryArchitecture