Subject: | NAPTR zone file incorrectly parsed from single line. v.710 |
NAPTR zone file incorrectly parsed from single line.
Here is my test:
This is incorrect
Parsing string
5.5.5.5 1200 IN NAPTR 100 100 "u" "E2U+X-ADDRESS"
"!^(.*)$!data:,CN=East test;ST=CT;C=United
States;uid=ast1;intrunk=dms500!" .
into RR object
$VAR1 = bless( {
'rdlength' => 0,
'ttl' => '1200',
'name' => '5.5.5.5',
'class' => 'IN',
'type' => 'NAPTR',
'rdata' => ''
}, 'Net::DNS::RR::NAPTR' );
This is correct
5.5.5.5. 1200 IN NAPTR 100 100 "u" "E2U+X-ADDRESS"
"!^(.*)$!data:,CN=East test;ST=CT;C=United
States;uid=ast1;intrunk=dms500!" .
Subject: | zoneparse.pl |
#!/usr/bin/perl
use warnings;
use strict;
use Net::DNS;
use Data::Dumper;
print "This is incorrect\n";
my $string = '5.5.5.5 1200 IN NAPTR 100 100 "u" "E2U+X-ADDRESS" "!^(.*)$!data:,CN=East test;ST=CT;C=United States;uid=ast1;intrunk=dms500!" .';
print "Parsing string \n $string \ninto RR object\n";
my $newrr1 = new Net::DNS::RR "$string";
print Dumper($newrr1);
print "\n";
my $newrr = Net::DNS::RR->new(name=> '5.5.5.5',
ttl=> 1200,
class=> 'IN',
type => 'NAPTR',
order => '100',
preference => '100',
flags => 'u',
service => 'E2U+X-ADDRESS',
regexp => '!^(.*)$!data:,CN=East test;ST=CT;C=United States;uid=ast1;intrunk=dms500!',
replacment => '.',
rdlength => 0,
rdata => '',
);
print "\nThis is correct\n";
print $newrr->string;