I tend to avoid gethostbyname and similar these days and instead turn to Net::DNS for all my DNS needs. Using this we can do:
#!/usr/bin/env perl use strict; use warnings; use Net::DNS; my @rr = rr ('www.perlmonks.org', 'A'); for my $rec (@rr) { next unless $rec->type eq 'A'; print "Found: " . $rec->rdstring . "\n"; }
🦛
In reply to Re: DNS lookup
by hippo
in thread DNS lookup
by g_speran
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |