A Connection to whois.arin.net is not open to us. Our network administrators say we should use 192.0.47.59 for our whois service.
In some cases I will have a DNS name, in other cases I will have an IP address. I want to get the whois information in either case. My network administrators have allowed access to a specific IP address for the whois service, and I have to use that IP address. The define method allows me to set the IP address of the whois service if I give it the TLD, but I have no way to get it work for IP addresses.
This is related to Setting address of whois service for ruby whois gem, but since I got a partial solution, I know how to call the service, so for my question specific to IP addresses I thought I would start over.
I need to set the address of our whois service. So for a DNS name:
> Whois.whois('wandajackson.com')
Whois::ConnectionError: Errno::EHOSTUNREACH: No route to host - connect(2) for "whois.verisign-grs.com" port 43
from (irb):4
> Whois::Server.define(:tld, 'com', '192.0.47.59')
=> ["com", "192.0.47.59", {}]
irb(main):006:0> Whois.whois('wandajackson.com')
# => #<Whois::Record>
However, I cannot get it to work for IP addresses.
> Whois::Server.define(:ipv4, '74.0.0.0/8', '192.0.47.59')
=> ["74.0.0.0/8", "192.0.47.59", {}]
> Whois.whois('74.220.215.203')
Whois::ConnectionError: Errno::EHOSTUNREACH: No route to host - connect(2) for "whois.arin.net" port 43
from (irb):7
> Whois::Server.define(:ipv6, '2607::/8', '192.0.47.59')
=> ["2607::/8", "192.0.47.59", {}]
> Whois.whois('2607:f8b0:4004:800::200e')
Whois::ConnectionError: Errno::EHOSTUNREACH: No route to host - connect(2) for "whois.arin.net" port 43
from (irb):9