Skip Menu |

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

Report information
The Basics
Id: 6436
Status: resolved
Priority: 0/
Queue: Net-DNS

People
Owner: OLAF [...] cpan.org
Requestors: simon [...] josefsson.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.46
Fixed in: 0.50



Subject: Owner name with SPC
Hello. The script below look up ("foo bar.josefsson.org",IN,TXT) once, and then look up $rr->name again, which fails. The problem is that $rr->name look like "foo\032bar.josefsson.org", which Net::DNS itself cannot handle. Is there some way around this? Thank you. #!/usr/bin/perl use strict; use Net::DNS; print "version $Net::DNS::VERSION\n"; my $domain = "foo bar.josefsson.org"; my $res = Net::DNS::Resolver->new; #$res->nameservers("yxa.extundo.com"); $res->debug(1); my $rr; my $query = $res->query($domain, "TXT"); die "No TXT for $domain: ", $res->errorstring, "\n" unless defined($query) and ($query->header->ancount > 0) and ($rr = ($query->answer)[0]) and ($rr->type eq "TXT"); $rr->print; print "\nRR name is ", $rr->name, "\n\n"; $query = $res->query($rr->name, "TXT"); die "No TXT for $rr->name: ", $res->errorstring, "\n" unless defined($query) and ($query->header->ancount > 0) and ($rr = ($query->answer)[0]) and ($rr->type eq "TXT"); $rr->print; Output on my Debian i386 machine: version 0.46 ;; query(foo bar.josefsson.org, TXT, IN) ;; send_udp(192.168.1.1:53) ;; answer from 192.168.1.1:53 : 150 bytes ;; HEADER SECTION ;; id = 51830 ;; qr = 1 opcode = QUERY aa = 0 tc = 0 rd = 1 ;; ra = 1 ad = 0 cd = 0 rcode = NOERROR ;; qdcount = 1 ancount = 1 nscount = 3 arcount = 1 ;; QUESTION SECTION (1 record) ;; foo\032bar.josefsson.org. IN TXT ;; ANSWER SECTION (1 record) foo\032bar.josefsson.org. 3336 IN TXT "Med space" ;; AUTHORITY SECTION (3 records) josefsson.org. 35736 IN NS vic20.blipp.com. josefsson.org. 35736 IN NS syl.extundo.com. josefsson.org. 35736 IN NS yxa.extundo.com. ;; ADDITIONAL SECTION (1 record) yxa.extundo.com. 158249 IN A 217.13.230.178 foo\032bar.josefsson.org. 3336 IN TXT "Med space" RR name is foo\032bar.josefsson.org ;; query(foo\032bar.josefsson.org, TXT, IN) ;; send_udp(192.168.1.1:53) ;; answer from 192.168.1.1:53 : 384 bytes ;; HEADER SECTION ;; id = 51831 ;; qr = 1 opcode = QUERY aa = 0 tc = 0 rd = 1 ;; ra = 1 ad = 0 cd = 0 rcode = NXDOMAIN ;; qdcount = 1 ancount = 0 nscount = 4 arcount = 0 ;; QUESTION SECTION (1 record) ;; foo\\032bar.josefsson.org. IN TXT ;; ANSWER SECTION (0 records) ;; AUTHORITY SECTION (4 records) josefsson.org. 10536 IN SOA belsebub.onkel. jas.pdc.kth.se. ( 2004052201 ; Serial 10800 ; Refresh 3600 ; Retry 604800 ; Expire 36000 ) ; Minimum TTL josefsson.org. 10536 IN SIG SOA 1 2 36000 20040622171302 ( 20040523171302 8375 josefsson.org jXsBJJdmfnQ0/s+wsSfvJZyKQ2WHYEynVPtPhz1+EWNCn LLRZ3hEndYp5GusE1cDBP9mE1UwAYWdYteB+7mikw== ) foo\032bar.josefsson.org. 10536 IN NXT iesg--rksmrgs-5wao1o.josefsson.org NXT SIG TXT foo\032bar.josefsson.org. 10536 IN SIG NXT 1 3 36000 20040622171302 ( 20040523171302 8375 josefsson.org OtNmzO2SOu19JbSihBXeahE4fc/kR/s9re4I3TQJGpvnZ eHDsELmFwgRS4Fqf9LzvuGip9pzU56J1DZftHePhQ== ) ;; ADDITIONAL SECTION (0 records) No TXT for Net::DNS::RR::TXT=HASH(0x86768a0)->name: NXDOMAIN
From: Chris Reinhardt <chris [...] dyndns.org>
Subject: Re: [cpan #6436] Owner name with SPC
Date: Mon, 31 May 2004 00:02:28 -0400
To: bug-Net-DNS [...] rt.cpan.org
RT-Send-Cc:
On May 27, 2004, at 9:28 AM, Guest via RT wrote: Show quoted text
> > This message about Net-DNS was sent to you by guest <> via rt.cpan.org > > Full context and any attached attachments can be found at: > <URL: https://rt.cpan.org/Ticket/Display.html?id=6436 > > > Hello. The script below look up ("foo bar.josefsson.org",IN,TXT) > once, and then look up $rr->name again, which fails. The problem is > that $rr->name look like "foo\032bar.josefsson.org", which Net::DNS > itself cannot handle. Is there some way around this? Thank you. >
Hrrrm.... that is certainly legal under RFC 2181 (though I personally don't like putting spaces in a DNS name.) Net::DNS should handle such names correctly, though this is a can of worms. Technically a label can be any binary data, which brings up questions on encoding and displaying labels. Still, we should at least work with ASCII correctly :D. -- Chris Reinhardt -- chris@dyndns.org -- http://www.dyndns.org/ If you've never seen an elephant ski then you've never been on acid! --Eddie Izzard
Hi Simon, I have been trying to fix this in the context of "white lies" (I know that the ticket submitter knows what I am talking about). One of the problems I ran into is that the dn_expand function from different libresolv implementations return different things when using non-ascii characters. The main difference is in escaping "special" characters. This is in the queue to be fixed but may take a while contact me if you need this urgently. --Olaf
As of 0.50 Net::DNS supports binary labels. Ticket resolved, feel free to reopen if your ticket has not been prolerly addressed though. --Olaf