Reverse DNS for list of domains?

dan radom dan at radom.org
Wed Dec 17 04:48:35 CST 2003


* Bradley Miller (bradmiller_kclug at sbcglobal.net) wrote:
> Is there a handy script I could run to check a list of domains for proper 
> (any?) reverse DNS ? I think I've got some stragglers out there, but I've 
> got too many to check by hand . . .
> 

use perl's Net::DNS.  Here's one I use for checking authority that could
be easily modified...

#!/usr/bin/perl
#
#
use Net::DNS;

$zonefile = "/home/graffix/zonelist.no-apra";

my $res = Net::DNS::Resolver->new;

open( ZONES, "$zonefile" );
while( <ZONES> ) {  chomp; print "$_n"; my $query = $res->query($_,
"NS");

        if ($query) {
                foreach $rr (grep { $_->type eq 'NS' } $query->answer) {
                        print $rr->nsdname, "n";
                }
        }
        else {
          warn "query failed: ", $res->errorstring, "n";
        }
}
close( ZONES );




More information about the Kclug mailing list