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"; }
In reply to Re: Pulling IPv6 Address from Hostname
by idsfa
in thread Pulling IPv6 Address from Hostname
by gokuraku
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |