0

Is there a way to use the whois gem (https://github.com/weppos/whois) with a -h flag? I am looking to run whois queries against a specific database host in my rails project (e.g. whois -h whois.myserver.example google.com)

If not, are there other ways to accomplish this?

Patrick Mevzek
  • 10,995
  • 16
  • 38
  • 54
S L
  • 11
  • 2

1 Answers1

0

From the documentation at https://www.rubydoc.info/gems/whois/Whois/Client

Parameters:

settings (Hash) (defaults to: {}) —

Hash of settings to customize the client behavior.

Options Hash (settings):

:timeout (Integer, nil) — default: DEFAULT_TIMEOUT —

The timeout for a WHOIS query, expressed in seconds.
:bind_host (String) — default: nil —

Providing an IP address or hostname will bind the Socket connection to the specific local host.
:bind_port (Fixnum) — default: nil —

Providing port number will bind the Socket connection to the specific local port.
:host (String, nil) — default: nil —

The server host to query. Leave it blank for intelligent detection.

So

client = Whois::Client.new(:host => "whois.myserver.example")

should be what you need. No idea if you need to change the port too.

Patrick Mevzek
  • 10,995
  • 16
  • 38
  • 54