in reply to Re: Retrieving all hostnames for an IP address...
in thread Retrieving all hostnames for an IP address...
I agree with you that Net::DNS is the way to go, but I also agree with the poster above that there's, many times, more than one PTR. Also, it would seem the parent poster is looking for PTR records, not A records. I sometimes lookup the A records for a PTR to see if they match...
UPDATE: After reading the update to the question I deleted much of this post and put this instead. It might even be what the asker wants, or close to it...
use strict; use Net::DNS; my $res = new Net::DNS::Resolver; for my $rr ($res->axfr('domain.name')) { next unless $rr->type eq "A"; my $host = $rr->name; my $ip = $rr->address; next unless $ip eq "ip.ip.ip.ip"; print "$host\n"; }
|
|---|