Skip Menu |

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

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

People
Owner: OLAF [...] cpan.org
Requestors: r.felber [...] ek-muc.de
Cc:
AdminCc:

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



Subject: TCP connections seem to be buggy
$res->send(62.154.174.130) leads to a empty $res object because the query returns 44 records, which is too big for an UDP packet. Net::DNS tries tcp connections which fail with default tcp options. Workaround: $res->igntc(1)
[guest - Mon Aug 8 04:04:23 2005]: Show quoted text
> $res->send(62.154.174.130) > > leads to a empty $res object because the query returns 44 records, > which is too big for an UDP packet. Net::DNS tries tcp connections > which fail with default tcp options. > > Workaround: $res->igntc(1) > >
Are you sure you are not behind a firewall that causes TCP on port 53 to be blocked. I tried to reproduce your problem but failed, the code falls back to TCP.... see below: I created one entry in the net-dns.org zone called overflow.net-dns.org. The TXT RRset at that name will overflow even a EDNS 4096 sized packet. When I run this script: #!/usr/bin/perl -w use Net::DNS::Resolver; my $res=Net::DNS::Resolver->new( nameservers => [qw(193.0.4.49)], recurse => 0, debug => 1, ); $res->send("overflow.net-dns.org","TXT"); I get: ;; setting up an AF_INET() family type UDP socket ;; send_udp(193.0.4.49:53) ;; answer from 193.0.4.49:53 : 500 bytes ;; HEADER SECTION ;; id = 61815 ;; qr = 1 opcode = QUERY aa = 1 tc = 1 rd = 0 ;; ra = 0 ad = 1 cd = 0 rcode = NOERROR ;; qdcount = 1 ancount = 6 nscount = 0 arcount = 0 ;; QUESTION SECTION (1 record) ;; overflow.net-dns.org. IN TXT ;; ANSWER SECTION (6 records) overflow.net-dns.org. 60 IN TXT "And line 58 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 59 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 60 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 224 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "An increadibly large answer section that will lead to packet overflow" overflow.net-dns.org. 60 IN TXT "And line 1 of al sorts of crap that will just fill the packet " ;; AUTHORITY SECTION (0 records) ;; ADDITIONAL SECTION (0 records) ;; ;; packet truncated: retrying using TCP ;; attempt to send_tcp(193.0.4.49:53) (src port = 0) ;; sending 38 bytes ;; read_tcp: expecting 2 bytes ;; read_tcp: received 2 bytes ;; read_tcp: expecting 4787 bytes ;; read_tcp: received 1446 bytes ;; read_tcp: expecting 3341 bytes ;; read_tcp: received 1448 bytes ;; read_tcp: expecting 1893 bytes ;; read_tcp: received 1893 bytes ;; received 4787 bytes ;; HEADER SECTION ;; id = 61815 ;; qr = 1 opcode = QUERY aa = 1 tc = 0 rd = 0 ;; ra = 0 ad = 0 cd = 0 rcode = NOERROR ;; qdcount = 1 ancount = 61 nscount = 3 arcount = 2 ;; QUESTION SECTION (1 record) ;; overflow.net-dns.org. IN TXT ;; ANSWER SECTION (61 records) overflow.net-dns.org. 60 IN TXT "And line 57 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 58 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 59 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 60 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 224 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "An increadibly large answer section that will lead to packet overflow" overflow.net-dns.org. 60 IN TXT "And line 1 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 2 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 3 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 4 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 5 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 6 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 7 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 8 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 9 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 10 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 11 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 12 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 13 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 14 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 15 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 16 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 17 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 18 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 19 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 20 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 21 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 22 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 23 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 25 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 26 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 27 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 28 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 29 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 30 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 31 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 32 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 33 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 34 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 35 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 36 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 37 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 38 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 39 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 40 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 41 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 42 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 43 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 44 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 45 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 46 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 47 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 48 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 49 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 50 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 51 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 52 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 53 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 54 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 55 of al sorts of crap that will just fill the packet " overflow.net-dns.org. 60 IN TXT "And line 56 of al sorts of crap that will just fill the packet " ;; AUTHORITY SECTION (3 records) net-dns.org. 3600 IN NS ns.hactrn.net. net-dns.org. 3600 IN NS ns1.net-dns.org. net-dns.org. 3600 IN NS ns-sec.ripe.net. ;; ADDITIONAL SECTION (2 records) ns1.net-dns.org. 3600 IN A 193.0.4.49 ns1.net-dns.org. 3600 IN AAAA 2001:610:240:3:0:1234:be21:e31e
From: r.felber [...] ek-muc.de
On Fri, Sep 23, 2005 at 08:03:06AM -0400, Olaf Kolkman via RT wrote: Show quoted text
> Full context and any attached attachments can be found at: > <URL: http://rt.cpan.org/NoAuth/Bug.html?id=14049 > > > [guest - Mon Aug 8 04:04:23 2005]: >
> > $res->send(62.154.174.130) > > > > leads to a empty $res object because the query returns 44 records, > > which is too big for an UDP packet. Net::DNS tries tcp connections > > which fail with default tcp options. > > > > Workaround: $res->igntc(1) > > > >
> > Are you sure you are not behind a firewall that causes TCP on port 53
to be blocked. I'm unsure whether replying via E-Mail works, thus I reply via the Webinterface, too: I'm certain that it is not blocked: % host 62.154.174.130 Gives me 44 records while using /etc/resolv.conf While Net::DNS gives me: #!/usr/bin/perl use Net::DNS; $r = Net::DNS::Resolver->new(debug=>1); $r->send("62.154.174.130"); ;; Trying to set up a AF_INET6() family type UDP socket with srcaddr: 0.0.0.0 ... failed ;; setting up an AF_INET() family type UDP socket ;; send_udp(192.168.0.11:53) ;; answer from 192.168.0.11:53 : 502 bytes ;; HEADER SECTION ;; id = 6061 ;; qr = 1 opcode = QUERY aa = 0 tc = 1 rd = 1 ;; ra = 1 ad = 0 cd = 0 rcode = NOERROR ;; qdcount = 1 ancount = 17 nscount = 0 arcount = 0 ;; QUESTION SECTION (1 record) ;; 130.174.154.62.in-addr.arpa. IN PTR ;; ANSWER SECTION (17 records) 130.174.154.62.in-addr.arpa. 86210 IN PTR mail.atu.info. 130.174.154.62.in-addr.arpa. 86210 IN PTR mail.oris.info. 130.174.154.62.in-addr.arpa. 86210 IN PTR mail.shop.kupplung.de. 130.174.154.62.in-addr.arpa. 86210 IN PTR mail.bosal.info. 130.174.154.62.in-addr.arpa. 86210 IN PTR mail.brink.info. 130.174.154.62.in-addr.arpa. 86210 IN PTR mail.esatz.info. 130.174.154.62.in-addr.arpa. 86210 IN PTR mail.kovil.info. 130.174.154.62.in-addr.arpa. 86210 IN PTR mail.mamut.info. 130.174.154.62.in-addr.arpa. 86210 IN PTR mail.e-satz.info. 130.174.154.62.in-addr.arpa. 86210 IN PTR mail.jaeger.info. 130.174.154.62.in-addr.arpa. 86210 IN PTR mail.mammut.info. 130.174.154.62.in-addr.arpa. 86210 IN PTR mail.towbar.info. 130.174.154.62.in-addr.arpa. 86210 IN PTR mail.ankufix.at. 130.174.154.62.in-addr.arpa. 86210 IN PTR mail.ankufix.ch. 130.174.154.62.in-addr.arpa. 86210 IN PTR mail.ankufix.de. 130.174.154.62.in-addr.arpa. 86210 IN PTR mail.ankufix.com. 130.174.154.62.in-addr.arpa. 86210 IN PTR mail.carpart.info. ;; AUTHORITY SECTION (0 records) ;; ADDITIONAL SECTION (0 records) ;; ;; packet truncated: retrying using TCP ;; attempt to send_tcp(192.168.0.11:53) (src port = 0) ;; ERROR: send_tcp: connection failed: Invalid argument However, I'm using p5-Net-DNS-0.53 on a FreeBSD 5.3 machine. What else could I try?
CC: r.felber [...] ek-muc.de
From: Olaf M. Kolkman <olaf [...] dacht.net>
Subject: Re: [cpan #14049] TCP connections seem to be buggy
Date: Fri, 23 Sep 2005 16:00:35 +0200
To: bug-Net-DNS [...] rt.cpan.org
RT-Send-Cc:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sep 23, 2005, at 15:15 , Guest via RT wrote: Show quoted text
> ;; packet truncated: retrying using TCP > ;; attempt to send_tcp(192.168.0.11:53) (src port = 0) > >
;; packet truncated: retrying using TCP ;; attempt to send_tcp(192.168.0.11:53) (src port = 0) You are talking to a machine on RFC1918 space, that suggests you are behind a NAT which opens a can of worms, troubleshooting wise... Have you tried you can at least get a socket open to that machine Show quoted text
> telnet 192.168.0.11 53
should provide you with an open socket... Are you sure 'host' does (not) talk to the NAT box? - --Olaf -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) Comment: This message is locally signed. iD8DBQFDNApptN/ca3YJIocRAsvfAJ9HIJ4CVI0lWJDkQop4F+89ZIrbEQCgha4E SyHF+3M5NKeXYdkpJPZgZnU= =Ghm1 -----END PGP SIGNATURE-----
From: r.felber [...] ek-muc.de
[olaf@dacht.net - Fri Sep 23 10:01:20 2005]: Show quoted text
> ;; packet truncated: retrying using TCP > ;; attempt to send_tcp(192.168.0.11:53) (src port = 0) > > > You are talking to a machine on RFC1918 space, that suggests you are > behind a NAT which opens a can of worms, troubleshooting wise... > > Have you tried you can at least get a socket open to that machine
> > telnet 192.168.0.11 53
> should provide you with an open socket...
[robtone@fpsvr1z150:~]% telnet 192.168.0.11 53 16:24:23 Trying 192.168.0.11... Connected to mailsrv.dartsd66.local. Escape character is '^]'. Show quoted text
> Are you sure 'host' does (not) talk to the NAT box?
Yes. nslookup does so, too: -[robtone@fpsvr1z150:~]% nslookup 62.154.174.130 192.168.0.11 16:30:19 ;; Truncated, retrying in TCP mode. Server: 192.168.0.11 Address: 192.168.0.11#53 Non-authoritative answer: 130.174.154.62.in-addr.arpa name = mail.atu.info. 130.174.154.62.in-addr.arpa name = mail.oris.info. 130.174.154.62.in-addr.arpa name = mail.shop.kupplung.de. 130.174.154.62.in-addr.arpa name = mail.bosal.info. 130.174.154.62.in-addr.arpa name = mail.brink.info. 130.174.154.62.in-addr.arpa name = mail.esatz.info. 130.174.154.62.in-addr.arpa name = mail.kovil.info. 130.174.154.62.in-addr.arpa name = mail.mamut.info. 130.174.154.62.in-addr.arpa name = mail.e-satz.info. 130.174.154.62.in-addr.arpa name = mail.jaeger.info. 130.174.154.62.in-addr.arpa name = mail.mammut.info. 130.174.154.62.in-addr.arpa name = mail.towbar.info. 130.174.154.62.in-addr.arpa name = mail.ankufix.at. 130.174.154.62.in-addr.arpa name = mail.ankufix.ch. 130.174.154.62.in-addr.arpa name = mail.ankufix.de. 130.174.154.62.in-addr.arpa name = mail.ankufix.com. 130.174.154.62.in-addr.arpa name = mail.carpart.info. 130.174.154.62.in-addr.arpa name = mail.kuplung.de. 130.174.154.62.in-addr.arpa name = mail.mammuth.info. 130.174.154.62.in-addr.arpa name = mail.rameder.de. 130.174.154.62.in-addr.arpa name = mail.towbars.info. 130.174.154.62.in-addr.arpa name = mail.wessels.info. 130.174.154.62.in-addr.arpa name = mail.carparts.info. 130.174.154.62.in-addr.arpa name = mail.europart.info. 130.174.154.62.in-addr.arpa name = mail.kupplung.at. 130.174.154.62.in-addr.arpa name = mail.kupplung.de. 130.174.154.62.in-addr.arpa name = mail.kupplung.com. 130.174.154.62.in-addr.arpa name = mail.lafuente.info. 130.174.154.62.in-addr.arpa name = mail.rometech.de. 130.174.154.62.in-addr.arpa name = mail.kfz-teile.info. 130.174.154.62.in-addr.arpa name = mail.ottomobil.info. 130.174.154.62.in-addr.arpa name = mail.westfalia.info. 130.174.154.62.in-addr.arpa name = mail.ottomobile.info. 130.174.154.62.in-addr.arpa name = mail.stahlgruber.info. 130.174.154.62.in-addr.arpa name = mail.towbar-shop.info. 130.174.154.62.in-addr.arpa name = mail.0800kupplung.de. 130.174.154.62.in-addr.arpa name = mail.erich-jaeger.info. 130.174.154.62.in-addr.arpa name = mail.0800-kupplung.de. 130.174.154.62.in-addr.arpa name = mail.atu-autoteile.info. 130.174.154.62.in-addr.arpa name = mail.elektrosaetze.info. 130.174.154.62.in-addr.arpa name = mail.autoteile-shop.info. 130.174.154.62.in-addr.arpa name = mail.kupplungs-shop.info. 130.174.154.62.in-addr.arpa name = mail.zugvorrichtung.info. Authoritative answers can be found from:
[olaf@dacht.net - Fri Sep 23 10:01:20 2005]: Show quoted text
> > You are talking to a machine on RFC1918 space, that suggests you are > behind a NAT which opens a can of worms, troubleshooting wise... >
Well, Net::DNS tries to use IO::Socket::INET6 I've no INET6 (allthough the module is installed). Maybe a setting of Resolver->new(IPVer=>[4|6]) could solve this?
From: "Olaf M. Kolkman" <olaf [...] dacht.net>
Subject: Re: [cpan #14049] TCP connections seem to be buggy
Date: Sat, 24 Sep 2005 11:19:43 +0200
To: bug-Net-DNS [...] rt.cpan.org
RT-Send-Cc:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Show quoted text
> > Well, Net::DNS tries to use IO::Socket::INET6 > I've no INET6 (allthough the module is installed).
Yep.. thats it, don;t know why I did not think of this, while the error message should have provided a clear hint. Show quoted text
> > Maybe a setting of Resolver->new(IPVer=>[4|6]) could solve this? >
There is such functionality $res->force_v4(); will force IPv4 transport. (Documented in Net::DNS::Resolver perldoc, somewhere near the bottom). I think force_v4 will work for now but I take this as a request for implementing some sort of fallback mechanism. - --Olaf -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) Comment: This message is locally signed. iD4DBQFDNRpAtN/ca3YJIocRAlitAKD/RtpUfPH/ukdZDCT74cunxq1tGACXTaG9 KqyktILT1I1PG9K3qY8WoQ== =KkpB -----END PGP SIGNATURE-----
From: r.felber [...] ek-muc.de
[olaf@dacht.net - Sat Sep 24 05:20:54 2005]: Show quoted text
> > > > Maybe a setting of Resolver->new(IPVer=>[4|6]) could solve this? > >
> > There is such functionality $res->force_v4(); will force IPv4 > transport. (Documented in Net::DNS::Resolver perldoc, somewhere near > the bottom).
Yes, you're right, I wondered at the code why it is asking for force_v4 but havent found it quickly in the doc. My fault. Show quoted text
> I think force_v4 will work for now but I take this as a request for > implementing some sort of fallback mechanism.
Fallback would be unless ($socket) {try ipv4}; unless($socket) error. I haven't looked at the UDP code, but I guess it is there already. You might wonder why I don't provide a patch - well, I'm not deeply involved into Net::DNS and I'm afraid of that I might introduce a new bug ;)
From: "Olaf M. Kolkman" <olaf [...] dacht.net>
Subject: Re: [cpan #14049] TCP connections seem to be buggy
Date: Sat, 24 Sep 2005 21:31:31 +0200
To: bug-Net-DNS [...] rt.cpan.org
RT-Send-Cc:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sep 24, 2005, at 11:34 AM, Guest via RT wrote: Show quoted text
> > You might wonder why I don't provide a patch - well, I'm not deeply > involved into Net::DNS and I'm afraid of that I might introduce a > new bug ;) >
I am deeply involved into Net::DNS and still introduce new bugs :-)... I'll look at it. Your input is appreciated... - --Olaf -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) Comment: This message is locally signed. iD8DBQFDNamhtN/ca3YJIocRAr3VAKCnjbw5mlRzMZmd1JYrpzxLMocuwwCglSXR xM5XsnMUXhZau99BichsodI= =MSLf -----END PGP SIGNATURE-----
I fixed this. The fallback lives on the net-dns trunk and is tested in the context of ticket 14653. --Olaf