Dig dns server with PERL

Today I created the PERL script to check if the DNS is resolve by other DNS servers
To do that you will need create the <b>checkdns.pl</b> file

#nano checkdns.pl

And paste the below code:

#!/usr/bin/perl
$file=$ARGV[0];
chomp($file);
@list = `cat $file`;

$filedns=$ARGV[1];
chomp($filedns);
@listdns = `cat $filedns`;

foreach $dns(@listdns) {
chomp($dns);
print "\n--------------\n$dns\n";

for ($count = 2; $count >= 1; $count--) {
foreach $domain(@list) {
chomp($domain);
$ns = `dig $dns $domain +short`;
chomp($ns);
$ns =~s/\n/\t/g;
print "$domain\t$ns\n";
}
}
}

After that you need two files
1- file where you will put your dns servers

#nano domains.txt

Here you fill in with domains that you would like to test

my.domain.com
second.domain.com
...

2- file with global (or your indyvidual) DNS servers that you want to check with:

@8.8.8.8
@8.8.4.4
@75.75.75.75
@208.67.222.222
@208.67.220.220
@209.244.0.3
@209.244.0.4
@156.154.70.1
@156.154.71.1
@81.218.119.11
@209.88.198.133

If you want to use it just run

./checkdns.pl domains.txt dnsservers.txt

Also you can use the http://dns.squish.net/ website, that will help you with that as well.