I'm attempting to convert an ip address (80.224.159.46) info a fully
qualified domain (46.159.244.80.sbl-xbl.spamhaus.org) and then make a dns
query to determine if any records exist. I cant seem to figure our what I'm
doing wrong here.


use strict;
use Net::DNS;

my($the_ip,$the_domain,$rr,$the_query);

$the_ip='80.224.159.46';

$the_ip =~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/;
$the_domain="$4.$3.$2.$1.sbl-xbl.spamhaus.org";

my $res = Net::DNS::Resolver->new(
        recurse => 1,
        debug => 0,
);

$the_query = $res->search($the_domain);

foreach $rr ($the_query->answer) {
        print $rr->address."\n";
}

_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to