I can't explain this behaviour...
#!/usr/bin/perl
use Net::DNS;
#use IO::Socket::IP;
$testcandidate="cl";
print "IPV4 test...\n";
$res = new Net::DNS::Resolver;
$res->tcp_timeout (1) ;
$res->retry (1) ;
$res->retrans (1) ;
$query = $res->nameservers('162.219.53.120');
$query = $res->query($testcandidate, "SOA");
print "What's in the array: \n";
print join ' ', $res->nameservers();
print "\n";
my $serial=($query->answer)[0]->serial, if ($query);
print "serial: $serial\n";
print "\n\nIPV6 test...\n";
$res = new Net::DNS::Resolver;
$res->tcp_timeout (1) ;
$res->retry (1) ;
$res->retrans (1) ;
$query = $res->nameservers('2620:10a:80d1:1053::120');
$query = $res->query($testcandidate, "SOA");
print "What's in the array: \n";
print join ' ', $res->nameservers();
print "\n";
my $serial=($query->answer)[0]->serial, if ($query);
print "serial: $serial\n";
Which outputs...
[root@ns01 jzack]# ./snippet
IPV4 test...
What's in the array:
162.219.53.120
serial: 2020070925
IPV6 test...
What's in the array:
serial:
How is it that the IPv6 address isn't even being mentioned when I print the array elements? I thought I was debugging a Net::DNS issue...but it seems I must be doing something wrong with arrays in general?
When I throw this into debug, I see:
IPV6 test...
;; query(cl, SOA)
;; setting up an AF_INET() family type UDP socket
So how do I get it to not use AF_INET?