On Fri, Mar 31, 2000 at 08:25:32AM -0500, Michael Alan Dorman wrote: > Raphael Hertzog <[EMAIL PROTECTED]> writes: > > could someone with a good knowledge of perl have a look at this > > problem ? > > Well, I would, if there appeared to be a problem. > > I get success. I would suggest this is either a kernel issue (I'm > using 2.2.15pre15) or a libc issue (I'm using 2.1.3).
The following is an email I sent to a smaller cc list before I saw the thread move to -qa & -perl. Can you confirm or deny what I found? I don't have time to dig any deeper into IO::Socket at the moment, and probably won't until sunday evening. There are a couple of problems here. The code snippit actually works if you remove the -T: (100)osgiliath:~/> ./test.dns.pl netscape.com success ...but the root servers only resolve first & second level domains: (101)osgiliath:~/> ./test.dns.pl com. success (102)osgiliath:~/> ./test.dns.pl www.netscape.com failure If you use a normal dns server (as opposed to a root server) you don't have that problem. I don't know if that might have been a point of confusion for the original submitter. The larger problem is that adding the -T make the code fail. IMHO, this isn't a problem in the Net::DNS library, but rather in the IO::Socket routines. If you specify an ip address rather than a name for the nameserver, the code works with -T. (And since /etc/resolv.conf uses ip's, this is why the default works.) If you go through the Net::DNS code and replace all instances of PeerAddr=>something (used when creating the IO::Socket::INET's) with PeerAddr=>IO::Socket::inet_ntoa(IO::Socket::inet_aton(something)) then you can use names as well as ip's for nameservers. So there's a workaround. But the IO::Socket man page specifies that hostnames are legal PeerAddr's, so the best course of action is probably to forward this bug to the IO::Socket maintainer. The actual failure condition for IO::Socket is calling peerhost on a udp socket which was created with a host name rather than an ip number for PeerAddr. (I didn't test tcp sockets, which might also fail.) -- Mike Stone
pgpTTZnLJbuKz.pgp
Description: PGP signature