weppos / whois

An intelligent — pure Ruby — WHOIS client and parser.

Home Page:https://whoisrb.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to specify whois server for request?

hxhxd opened this issue · comments

Hi, I've tried many times, seems it's not working:
client = Whois::Client.new(host: 'whois.crsnic.net', bind_host: ips[count % ipl])
or
Whois::Server.define :tld, ".com", "whois.crsnic.net"

But still I got error message:
"Errno::ECONNREFUSED: Connection refused - connect(2) for \"whois.bizcn.com\" port 43"

Is there a workaround for this? Like I build a server/adapter and pass it to client or so?
Thanks!

I'm confused that it's still using "whois.bizcn.com", is this related to #440 ?

Inside the tld.json file:
"com": {
"host": "whois.verisign-grs.com",
"adapter": "verisign"
},

Why does it still connecting whois.bizcn.com ?
Could anybody give me some hint? Thank you very much :)

whois.bizcn.com is not set anywhere, not even in the TLD definition. Therefore, it's likely to have some code that manipulates/overrides the host somewhere and it's causing the conflict.

client = Whois::Client.new(host: '...')
client.lookup("example.com")

is the correct way to use a specific host as server.

Thanks for reply.
client = Whois::Client.new(host: '...')
is the way I tried first. Yet it seems not working somehow.

My system is Freebsd 9, with ruby 2.4 and whois 4.0.6.

You need to find what code is currently conflicting as the host is being overridden somewhere in your code introducing a host that I don't recognize.