in reply to DNS lookup
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"; }
🦛
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: DNS lookup
by g_speran (Scribe) on Feb 14, 2023 at 17:31 UTC | |
by hippo (Archbishop) on Feb 14, 2023 at 18:45 UTC | |
by cavac (Prior) on Feb 15, 2023 at 12:51 UTC |