Subject: | Another bug? Net::DNS::ZoneFile |
Date: | Tue, 31 May 2016 20:06:06 +0000 |
To: | "bug-Net-DNS [...] rt.cpan.org" <bug-Net-DNS [...] rt.cpan.org> |
From: | "White, Andrew" <Andrew.White2 [...] charter.com> |
Another bug report. Net::DNS::ZoneFile barfs with an error if there is an implied @ after an $ORIGIN line.
# cat example.com.hosts
$TTL 1D
@ IN SOA ns1.example.com. admin.example.com. (
2016053100 ;serial
2h ; refresh (2 hour)
1h ; retry (1 hour)
1W ; expire (1 week)
1D ) ; minimum or neg ttl (1 day)
IN NS ns1.example.com.
IN NS ns2.example.com.
$ORIGIN example.com.
IN A 1.2.3.4
# ./foo.pl
example.com. 86400 IN SOA ns1.example.com. admin.example.com. 2016053100 7200 3600 604800 86400
example.com. 86400 IN NS ns1.example.com.
example.com. 86400 IN NS ns2.example.com.
Can't call method "string" on an undefined value at /usr/local/share/perl5/Net/DNS/RR.pm line 332.
# cat foo.pl
#!/usr/bin/perl
use strict;
use Net::DNS::RR;
use Net::DNS::ZoneFile;
my $zonefile = new Net::DNS::ZoneFile("example.com.hosts","example.com");
if (! $zonefile) {
die("Error\n");
}
my @rr = $zonefile->read or die("Could not parse $zonefile\n");
foreach my $rr (@rr) {
print $rr->plain . "\n";
}
Andrew White
Desk: 314.394-9594<sip:13143949594> | Cell: 314-452-4386<sip:1-314-452-4386> | Jabber<sip:andrew.white2@charter.com>
andrew.white2@charter.com<mailto:andrew.white2@charter.com>
Systems Engineer III, DAS DNS group
Charter Communications
12405 Powerscourt Drive<https://goo.gl/maps/AH2PXFKnaGU2>,<http://www.html5zombo.com/> St. Louis, MO 63131
From: White, Andrew
Sent: Tuesday, May 31, 2016 2:03 PM
To: 'bug-Net-DNS@rt.cpan.org'
Subject: Net::DNS::ZoneFile
Hi there,
I notice that Net::DNS::ZoneFile fails to parse records with class IN or type RR if they are mixed case. Example below. Is this a bug in Net::DNS::RR or Net::DNS::ZoneFile, or is this expected behavior? My reading of RFC-4343 is that these should be case-insensitive.
Andrew
$ cat example.com.hosts
$TTL 1D
@ IN SOA ns1.example.com. admin.example.com. (
2016053100 ;serial
2h ; refresh (2 hour)
1h ; retry (1 hour)
1W ; expire (1 week)
1D ) ; minimum or neg ttl (1 day)
IN NS ns1.example.com.
IN NS ns2.example.com.
foo In A 10.0.0.1
bar IN PTr foobar.example.com.
$ cat foo.pl
#!/usr/bin/perl
use strict;
use Net::DNS::RR;
use Net::DNS::ZoneFile;
my $zonefile = new Net::DNS::ZoneFile("example.com.hosts", "example.com");
if (! $zonefile) {
die("Error\n");
}
my @rr = $zonefile->read or die("Could not parse $zonefile\n");
foreach my $rr (@rr) {
print OUT $rr->plain . "\n";
}
$ ./foo.pl
unknown type PTr at /usr/local/share/perl5/Net/DNS/RR.pm line 660
file example.com.hosts line 13
at ./foo.pl line 12
unknown type In at /usr/local/share/perl5/Net/DNS/RR.pm line 660
file example.com.hosts line 12
at ./foo.pl line 12
Andrew White
Desk: 314.394-9594<sip:13143949594> | Cell: 314-452-4386<sip:1-314-452-4386> | Jabber<sip:andrew.white2@charter.com>
andrew.white2@charter.com<mailto:andrew.white2@charter.com>
Systems Engineer III, DAS DNS group
Charter Communications
12405 Powerscourt Drive<https://goo.gl/maps/AH2PXFKnaGU2>,<http://www.html5zombo.com/> St. Louis, MO 63131
Message body is not shown because it is too large.