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