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?
Hi,
approx. 3-5 months ago I had similar problem. The guy who helped tried to
help mes said that it works for him. Then he realized that he uses a newes
version of ruby (1.9.something at that time). So my first suggestion would
be to check (or to write) what version of ruby are you using.
I solved the problem using external command (host). I hope it helped a
bit.
Cheers,
V.
···
On Thu, May 14, 2009 at 05:29:50PM +0900, Qq Zz wrote:
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?
--
Posted via http://www.ruby-forum.com/\.
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?
You don't even say what platform you're on. If you're on a Unix-like
platform, then maybe you have something like
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 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?
You don't even say what platform you're on. If you're on a Unix-like
platform, then maybe you have something like
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?
Hi,
approx. 3-5 months ago I had similar problem. The guy who helped tried
to
help mes said that it works for him. Then he realized that he uses a
newes
version of ruby (1.9.something at that time). So my first suggestion
would
be to check (or to write) what version of ruby are you using.
I solved the problem using external command (host). I hope it helped a
bit.
the response is: address family for hostname not supported
Hmm. I too get that error on Windows:
ruby -v -rsocket -e "p Socket.getnameinfo(Socket.pack_sockaddr_in(0, '208.77.188.166'))"
ruby 1.8.4 (2005-12-24) [i386-mswin32]
-e:1:in `getnameinfo': getnameinfo: address family for hostname not supported. (SocketError)
from -e:1
ruby19 -v -rsocket -e "p Socket.getnameinfo(Socket.pack_sockaddr_in(0, '208.77.188.166'))"
ruby 1.9.1p129 (2009-05-12) [i386-mswin32_71]
-e:1:in `getnameinfo': getnameinfo: The requested name is valid and was found in the database,
but it does not have the correct associated data being resolved for. (SocketError)
from -e:1:in `<main>'