I need to check a list of domain names and get the list of domains with no NS (probably unregistered). I've already found a nice solution with ADNS and adnshost. The command "adnshost -a -tns domain.com" does what I need (The 4th column in the output will contain the result) but I want to achieve the same with Perl and Net::DNS::Async.
My code:
#!/usr/bin/perl -w
use strict;
use utf8;
use Net::DNS::Async;
my $c = new Net::DNS::Async(QueueSize => 1000, Retries => 3);
my $filename = 'domain_list.txt';
open(FH, '<', $filename);
while(<FH>){
chomp($url);
$c->add(\&callback, "$url");
}
$c->await();
sub callback {
my $response = shift;
print $response->string;
}
So, how do I get the needed info with Perl and Net::DNS::Async ?