#!/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"; #### [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: