Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add whois2.publicinternetregistry.net.rb #197

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants

From the new file,

  # ICANN registrars use whois2.publicinterestregistry.net,
  # a whitelisted, non-rate-limited server.

We currently set our own server to use this, à la

  case domain.tld
    when 'org' then Whois::Server.factory(:tld, '.org', PIR_WHOIS_SERVER_HOST,
        { adapter: Whois::Server::Adapters::Afilias })
    else Whois::Server.guess(domain.name)
   end

(Better way?)

This works fine except Parser.parser_klass can't find it, so I've added this file.

Wasn't apparent to me how I could add real value with tests but open to ideas.

There's a couple of misc fixes I spotted too.

Add whois2.publicinternetregistry.net.rb which is used by ICANN regis…
…trars. Remove redundant decompose_registrar in WhoisPirOrg. Refer to new Afilias adapter v. old Pir.

@ghost ghost assigned weppos Mar 29, 2013

Owner

weppos commented Mar 29, 2013

Hello Paul,

Sorry for the late reply. I'm a little bit concerned about the implications of using this registrar-reserved hostname in the whois library. According to IANA, the official whois server is whois.pir.org.

I'm afraid PIR would complain about shipping a library with a whois server reserved for registrars.

That said, you can easily change the server in your application by updating the TLD definitions. It's a little bit tricky because there are no built-in methods to alter the definitions, only methods to append.

tlds = Whois::Server.definitions(:tld)
tlds.find { |d| d.first == '.org' }[2] = 'whois2.publicinternetregistry.rb'

Remember that you will also need to include a parser for whois2.publicinternetregistry.rb if you want the client to be able to parse the result. It can be an alias of WhoisPirOrg parser.

@weppos weppos closed this Mar 29, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment