Skip Menu |

This queue is for tickets about the Net-DNS CPAN distribution.

Report information
The Basics
Id: 112759
Status: rejected
Priority: 0/
Queue: Net-DNS

People
Owner: Nobody in particular
Requestors: stuart.kendrick.sea [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Change in $rr->string output
Date: Mon, 7 Mar 2016 06:19:34 -0800
To: bug-net-dns [...] rt.cpan.org
From: Stuart Kendrick <stuart.kendrick.sea [...] gmail.com>
I am upgrading from v0.83 to v1.04 I believe I am seeing a change in how the string method outputs CNAME records. Code Snippet @zone = $res->axfer($zone); for my $rr (@zone) { my $record = $rr->string; print $record; } Under v0.83, I see A Records and CNAME Records as follows: AIADFSPROXY.company.com. 3600 IN A 10.70.44.78 aiadfsproxy1rib. company.com. 3600 IN CNAME aigate.company.com Under v1.04, I see A Records and CNAME Records as follows: AIADFSPROXY.company.com. 3600 IN A 10.70.44.78 aiadfsproxy1rib. company.com. 3600 IN CNAME ( aigate.company.com. ) Notice two changes under v1.04: The CNAME record splits into two lines (a carriage return appears after ‘(‘ The introduction of parentheses around the target record (aigate.company.com in the example above) This smells like a bug to me, as it makes parsing the result difficult (records split across multiple lines, rather than being returned as a single line). --sk
From: rwfranks [...] acm.org
On Mon Mar 07 09:19:47 2016, stuart.kendrick.sea@gmail.com wrote: Show quoted text
> I am upgrading from v0.83 to v1.04 > > I believe I am seeing a change in how the string method outputs CNAME > records. > > Code Snippet > @zone = $res->axfer($zone); > for my $rr (@zone) { > my $record = $rr->string; > print $record; > } > > Under v0.83, I see A Records and CNAME Records as follows: > AIADFSPROXY.company.com. 3600 IN A 10.70.44.78 > aiadfsproxy1rib. company.com. 3600 IN CNAME > aigate.company.com > > Under v1.04, I see A Records and CNAME Records as follows: > AIADFSPROXY.company.com. 3600 IN A > 10.70.44.78 > aiadfsproxy1rib. company.com. 3600 IN CNAME > ( > aigate.company.com. ) >
The above example fails to show the behaviour you describe. The text format is defined in RFC1035, 5.1. There are now so many RRs which need multi-line text representation that it make sense to have a general formatting mechanism. I assume that the unedited form of the CNAME was slightly longer which triggered a line break. Show quoted text
> This smells like a bug to me, as it makes parsing the result difficult > (records split across multiple lines, rather than being returned as a > single line).
DIY parsing should never be necessary: 1) If you obtained the RR from axfr() then the components an be obtained directly using $rr->owner, $rr->cname, and $rr->ttl. 2) If you are parsing a zone file (or string), then you can use Net::DNS::ZoneFile which knows about RFC1035 and can deal with multi-line RRs. Show quoted text
> > > --sk