CC: | Gabor Kiss <gabor.kiss [...] sophos.com> |
Subject: | Changes Interface for RR.pm |
Date: | Wed, 27 Jul 2016 14:04:22 +0000 |
To: | "bug-Net-DNS [...] rt.cpan.org" <bug-Net-DNS [...] rt.cpan.org> |
From: | Clement Law <Clement.Law [...] Sophos.com> |
Hello,
Whilst trying to get an IP address of a hostname, I’m using the following (pseudo)code:
…
use Net::DNS;
use Data::Dumper;
my $Dns = new Net::DNS::Resolver();
my $Query = $Dns->query(“somehostname”, ‘A’)
my($Resource) = $Query->answer()
print Dumper($Resource);
…
…and I get the following structure in Ubuntu Lucid:
$VAR1 = bless( {
'rdlength' => 4,
'ttl' => 900,
'name' => 'xxxxxx.yyyyyy.zzzzzz',
'address' => '10.123.123.12',
'class' => 'IN',
'type' => 'A',
'rdata' => '
�� '
}, 'Net::DNS::RR::A' );
Where rdata is raw data 4 bytes in length the corresponds to the plain text in the address field.
But in CentOS 7 and Ubuntu Xenial, I get:
$VAR1 = bless( {
'owner' => bless( {
'label' => [],
'origin' => bless( {
'label' => [
'xxxxxx',
'yyyyyy',
'zzzzzz'
]
}, 'Net::DNS::DomainName' )
}, 'Net::DNS::DomainName1035' ),
'address' => '
�� ',
'rdlength' => 4,
'class' => 1,
'ttl' => 900,
'type' => 1
}, 'Net::DNS::RR::A' );
I’m just looking for some documentation and changelogs as to why these changes were made. As far as I can see, in the latter example, the string information has been stripped out, meaning that I have to use the RR::rdstring() and RR:string() methods to extract the information I need.
I believe the former behaviour is present in Ubuntu Trusty, too.
Just for reference, the version of Net::DNS::RR.pm in Ubuntu Lucid is 758 (DNS.pm is 796)
In CentOS 7, it is 1094 (DNS.pm is (DNS.pm is 1095)
In Ubuntu Xenial, it is 1282 (DNS.pm is 1285)
Many thanks,
Clement Law
Show quoted text
________________________________
Sophos Ltd, a company registered in England and Wales, number 2096520, The Pentagon, Abingdon Science Park, Abingdon, OX14 3YP, United Kingdom