Skip Menu |

This queue is for tickets about the POE-Component-Client-DNS CPAN distribution.

Report information
The Basics
Id: 13492
Status: resolved
Priority: 0/
Queue: POE-Component-Client-DNS

People
Owner: Nobody in particular
Requestors: SAPER [...] cpan.org
Cc:
AdminCc:

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



Subject: mDNS incompatibility
Hello, After a few months of wondering why any PoCo-IRC based thing would refuse to connect to anything, I think I now have found the module to blame :-) The problem is that POE::Component::Client::DNS does not work on a station where a multicast DNS server is running (which is necessary for integrating in a ZeroConf environment). Here is the proof. First, here is my /etc/resolv.conf nameserver 127.0.0.1 nameserver 194.117.200.10 nameserver 194.117.200.15 The first entry points to the local multicast DNS daemon, tmdns(1), which only serves the .local domain. Now, let's run one of the tests with DEBUG. $ perl t/01_resolve.t 1..3 client started... irc.lagged.org (...none...) no resolver response irc.inter.net.il (...none...) no resolver response irc.east.gblx.net (...none...) no resolver response 10.0.0.25 (...none...) no resolver response irc.exodus.net (...none...) no resolver response irc.colorado.edu (...none...) no resolver response irc.concentric.net (...none...) no resolver response irc.homelien.no (...none...) no resolver response irc.ced.chalmers.se (...none...) no resolver response irc.total.net (...none...) no resolver response irc.fasti.net (...none...) no resolver response irc.etsmtl.ca (...none...) no resolver response irc.freei.net (...none...) no resolver response irc.powersurfr.com (...none...) no resolver response irc.du.se (...none...) no resolver response irc.Prison.NET (...none...) no resolver response poe.dynodns.net (...none...) no resolver response irc.enitel.no (...none...) no resolver response poe.perl.org (...none...) no resolver response irc.ins.net.uk (...none...) no resolver response irc.magic.ca (...none...) no resolver response poe.whee (...none...) no resolver response irc2.home.com (...none...) no resolver response irc.skynetweb.com (...none...) no resolver response irc.ef.net (...none...) no resolver response irc.umn.edu (...none...) no resolver response efnet.telstra.net.au (...none...) no resolver response irc.emory.edu (...none...) no resolver response irc.gigabell.de (...none...) no resolver response 127.0.0.1 (...none...) no resolver response poe.perl.org (...none...) no resolver response irc.plur.net (...none...) no resolver response altavista.com (...none...) no resolver response irc.mcs.net (...none...) no resolver response irc.perl.org (...none...) no resolver response poe.dynodns.net (...none...) no resolver response irc.rt.ru (...none...) no resolver response efnet.demon.co.uk (...none...) no resolver response irc.west.gblx.net (...none...) no resolver response irc.best.net (...none...) no resolver response irc.mpl.net (...none...) no resolver response localhost (...none...) no resolver response google.com (...none...) no resolver response irc.lightning.net (...none...) no resolver response irc.umich.edu (...none...) no resolver response irc.mindspring.com (...none...) no resolver response irc.stanford.edu (...none...) no resolver response irc.core.com (...none...) no resolver response yahoo.com (...none...) no resolver response answers : 0 timeouts : 0 no answers : 49 errors : 0 a records : 0 mx records : 0 cname records: 0 other records: 0 ok 1 ok 2 ok 3 client stopped... Not one answer. Now, I remove the first entry and re-ru nthe test. $ perl t/01_resolve.t 1..3 client started... poe.whee (...none...) no resolver response 127.0.0.1 (PTR ) localhost. altavista.com (SOA ) ns-admin.altavista.com. dns-technical.av.com. ( 2005012801 ; Serial 300 ; Refresh 100 ; Retry 604800 ; Expire 7200 ) ; Minimum TTL altavista.com (TXT ) "This domain sends no email" altavista.com (TXT ) "Null SPF is for tracking purposes only" altavista.com (TXT ) "All mail claiming to be from altavista.com is forged" altavista.com (TXT ) "v=spf1 +exists:CL.%{i}.FR.%{s}.HE.%{h}.null.spf.altavista.com -all" altavista.com (MX ) 0 . altavista.com (A ) 66.218.71.198 altavista.com (NS ) ns1-92.akam.net. altavista.com (NS ) ns1.yahoo.com. altavista.com (NS ) ns2.yahoo.com. altavista.com (NS ) ns3.yahoo.com. altavista.com (NS ) ns4.yahoo.com. altavista.com (NS ) ns5.yahoo.com. altavista.com (NS ) eur1.akam.net. localhost (...none...) no resolver response google.com (NS ) ns3.google.com. google.com (NS ) ns4.google.com. google.com (NS ) ns1.google.com. google.com (NS ) ns2.google.com. yahoo.com (A ) 216.109.112.135 yahoo.com (A ) 66.94.234.13 yahoo.com (MX ) 1 mx2.mail.yahoo.com. yahoo.com (MX ) 1 mx3.mail.yahoo.com. yahoo.com (MX ) 5 mx4.mail.yahoo.com. yahoo.com (MX ) 1 mx1.mail.yahoo.com. yahoo.com (NS ) ns1.yahoo.com. yahoo.com (NS ) ns2.yahoo.com. yahoo.com (NS ) ns3.yahoo.com. yahoo.com (NS ) ns4.yahoo.com. yahoo.com (NS ) ns5.yahoo.com. irc.east.gblx.net (...none...) no resolver response irc.ced.chalmers.se (...none...) no resolver response poe.perl.org (CNAME ) poe.eekeek.org. efnet.demon.co.uk (A ) 194.159.164.195 irc.ins.net.uk (...none...) no resolver response irc.lagged.org (A ) 198.3.160.3 10.0.0.25 (...none...) no resolver response poe.dynodns.net (A ) 63.149.6.91 poe.dynodns.net (A ) 198.31.34.114 irc.gigabell.de (A ) 212.114.35.50 irc.enitel.no (...none...) no resolver response irc.core.com (...none...) no resolver response irc.du.se (A ) 130.243.52.250 irc.colorado.edu (CNAME ) droopy.colorado.edu. irc.rt.ru (...none...) no resolver response irc.emory.edu (...none...) no resolver response irc.exodus.net (...none...) no resolver response irc.homelien.no (A ) 195.159.0.90 irc.homelien.no (AAAA ) 2001:840:0:1000:1:0:0:1 irc.etsmtl.ca (...none...) no resolver response irc.umich.edu (CNAME ) pegasus.us.itd.umich.edu. irc.fasti.net (...none...) no resolver response irc.umn.edu (CNAME ) babblex.tc.umn.edu. irc.powersurfr.com (MX ) 10 this.domain.is.not.used.for.email. irc.powersurfr.com (A ) 83.138.187.17 irc.inter.net.il (A ) 192.116.231.44 irc.inter.net.il (MX ) 10 etrn.inter.net.il. irc.inter.net.il (MX ) 0 efnet.org.il. irc.freei.net (...none...) no resolver response irc.west.gblx.net (...none...) no resolver response irc.concentric.net (NS ) ns1.cnc.net. irc.concentric.net (NS ) ns2.cnc.net. irc.concentric.net (CNAME ) irc-w1.concentric.net. irc.lightning.net (A ) 207.45.69.69 irc.mcs.net (A ) 216.97.242.40 poe.perl.org (CNAME ) poe.eekeek.org. irc.best.net (...none...) no resolver response irc.mindspring.com (A ) 198.51.77.22 irc.mpl.net (A ) 198.65.102.87 irc.skynetweb.com (...none...) no resolver response irc.plur.net (...none...) no resolver response irc.total.net (CNAME ) irc.magic.ca. poe.dynodns.net (A ) 198.31.34.114 poe.dynodns.net (A ) 63.149.6.91 irc.perl.org (NS ) ns2.develooper.com. irc.perl.org (NS ) ns3.develooper.com. irc.perl.org (NS ) ns.develooper.com. irc.perl.org (A ) 195.82.114.48 irc.perl.org (A ) 209.2.32.38 irc.perl.org (A ) 66.33.218.20 irc.perl.org (A ) 66.243.36.134 irc.perl.org (A ) 193.201.200.130 irc.perl.org (SOA ) ns.develooper.com. dnsoper.bitnames.com. ( 2005040803 ; Serial 5400 ; Refresh 5400 ; Retry 604800 ; Expire 1200 ) ; Minimum TTL irc.stanford.edu (MX ) 10 tantivy.stanford.edu. irc.stanford.edu (MX ) 30 w6yx.stanford.edu. irc.ef.net (...none...) no resolver response irc.magic.ca (A ) 204.92.73.10 irc2.home.com (...none...) no resolver response efnet.telstra.net.au (...none...) no resolver response irc.Prison.NET (MX ) 15 californiamenscolony.Prison.NET. irc.Prison.NET (MX ) 10 bastille.Prison.NET. irc.Prison.NET (A ) 64.124.0.94 answers : 28 timeouts : 0 no answers : 21 errors : 0 a records : 25 mx records : 12 cname records: 7 other records: 29 ok 1 ok 2 ok 3 client stopped... Much better! Now, I have tried to look the code of PoCo::Client::DNS but I suspect that it's only looking after the first DNS server, not even trying to ask the next servers. The good thing to do would be (IMHO) to iterate through the list of servers and ask each of them until you have an answer. Ask me if you want me to make more tests. Regards, Sébastien Aperghis-Tramoni
[SAPER - Thu Jun 30 19:04:25 2005]: Show quoted text
> Hello, > > After a few months of wondering why any PoCo-IRC based thing would > refuse to connect to anything, I think I now have found the module > to blame :-) > > The problem is that POE::Component::Client::DNS does not work on a > station where a multicast DNS server is running (which is necessary > for integrating in a ZeroConf environment). Here is the proof. > > First, here is my /etc/resolv.conf > > nameserver 127.0.0.1 > nameserver 194.117.200.10 > nameserver 194.117.200.15 > > The first entry points to the local multicast DNS daemon, tmdns(1), > which only serves the .local domain. Now, let's run one of the > tests with DEBUG.
[...] Sébastien, POE::Component::Client::DNS uses Net::DNS::Resolver internally to perform lookups. It appears that Net::DNS::Resolver is stopping at the first host it finds. I should be able to work around this by calling $resolver->nameservers() to find the nameserver list. I can then create a list of resolvers for each nameserver, and query them individually. My more immediate problem is that I don't have a nameserver that responds only to certain addresses. I cannot test a fix without one, and I cannot include a test case in the next release without one that answers public queries. Would you happen to know of such a nameserver? Thank you. -- Rocco Caputo
The issue is that the first nameserver in resolv.conf points to a mdns server that doesn't answer general requests. General DNS requests fail, and the POE component doesn't fall back to the next resolver in resolv.conf. Net::DNS's bgsend() method, which the POE component uses, is hardcoded to use the first nameserver in its list. Outside code cannot retry a request with a different nameserver. Since bgsend() is unsuitable for fallback, it may be necessary to reimplement it within POE::Component::Client::DNS.
I have committed revision 75, which cycles through resolvers if the first one in the list (the one that Net::DNS::bgsend uses) times out. To avoid initial failures, the component sets the internal timeout to half the requested value. It will retry for the remaining time with the new resolver.