N
Nathaniel Talbott
I'm trying to use TCPSocket.gethostbyname to verify that a given domain
actually exists in DNS. For some reason, though, some domains fail to
resolve that resolve fine using other applications. For instance:
irb(main):001:0> require 'socket'
=> true
irb(main):002:0> TCPSocket.gethostbyname('noblepack.com')
SocketError: host not found
from (irb):2:in `gethostbyname'
from (irb):2
irb(main):003:0> TCPSocket.gethostbyname('google.com')
=> ["www.google.com", [], 2, "216.239.37.100"]
I can browse to either of those hosts, so what's different about them? Any
help would be greatly appreciated; my guess is that I just fail to
understand something critical about DNS and/or gethostbyname.
Thanks,
Nathaniel
<
(><
actually exists in DNS. For some reason, though, some domains fail to
resolve that resolve fine using other applications. For instance:
irb(main):001:0> require 'socket'
=> true
irb(main):002:0> TCPSocket.gethostbyname('noblepack.com')
SocketError: host not found
from (irb):2:in `gethostbyname'
from (irb):2
irb(main):003:0> TCPSocket.gethostbyname('google.com')
=> ["www.google.com", [], 2, "216.239.37.100"]
I can browse to either of those hosts, so what's different about them? Any
help would be greatly appreciated; my guess is that I just fail to
understand something critical about DNS and/or gethostbyname.
Thanks,
Nathaniel
<