From: Qq Zz Date: 2009-05-14T19:49:04+09:00 Subject: Re: the question about getaddinfo Bill Kelly wrote: > From: "Qq Zz" >> >> I use getaddinfo to get A machine's hostname, >> in B machine,the result is correct. >> but in A machine,the result is just A machine's name >> I use nslookup,the result is also correct. >> who can tell me why in A machine,the result is wrong? > > I ran into something similar awhile back: > http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/13805 > > This is what I now use: > > ip = "208.77.188.166" > result = Socket.getnameinfo( Socket.pack_sockaddr_in(0, ip) ) > hostname = result ? result.first : ip > > > Hope this helps, > > Bill the response is: address family for hostname not supported oh my god!!! -- Posted via http://www.ruby-forum.com/.