in reply to Pulling IPv6 Address from Hostname
use Net::DNS; my $res = Net::DNS::Resolver->new; my $query = $res->query("example.com", "AAAA"); if ($query) { foreach $rr (grep { $_->type eq 'AAAA' } $query->answer) { print $rr->address, "\n"; } } else { warn "query failed: ", $res->errorstring, "\n"; }
The intelligent reader will judge for himself. Without examining the facts fully and fairly, there is no way of knowing whether vox populi is really vox dei, or merely vox asinorum. — Cyrus H. Gordon
|
---|
In Section
Seekers of Perl Wisdom