4

Does anyone know about how to go about doing a WhoIs lookup (PHP or JavaScript) for the new sponsored TLDs that are coming out - things like .insurance .guru etc - there appears to be hundreds of them.

In other words as the new domains come on line will a generic query to a single whois server Whois.net?? resolve the new domain names or will there be a different whois server for every tld.

EDIT: To clear up some confusion - I am trying to work out domain availability for the new tlds not a dns lookup using the new tlds. Although thinking about it if a domain is being used it sure isn't available.

iglvzx
  • 498
  • 1
  • 8
  • 22
Brenton Thomas
  • 618
  • 1
  • 7
  • 17
  • 1
    They'll work like any OTHER TLD in the DNS system - if your local dns server doesn't know the answer, it'll work its way upstream until it finds a server which DOES know the answer (e.g. the root servers). The whois servers, if they don't know the answer, will tell you where to go look for answers. – Marc B Jan 05 '14 at 07:11
  • I think I have gotten it all backwards then. Perhaps phpWhoIs http://phpwhois.ols.es/ confused me. It has a great long list of national tlds and servers and I was thinking I had to get the right server for each domain. – Brenton Thomas Jan 05 '14 at 07:47
  • 1
    WHOIS is not part of the DNS system. Which one are you asking about? –  Jan 05 '14 at 07:57
  • I was originally asking about whois - and yes I see I do have it backwards - will edit the above – Brenton Thomas Jan 05 '14 at 10:07

1 Answers1

5

Similar to DNS, there is actually a root server for domain name Whois information: whois.iana.org.

By concept, all Whois lookups should be starting at whois.iana.org and then parsing the data for a link to the next Whois server and so on.

Some time ago, though, it became the norm to simply hard-code the Whois servers in your Whois lookup tool for each domain name extension. This saves time when doing a Whois lookup because you are skipping a step, but it requires you to manually maintain your Whois lookup tool to add new TLDs as they are released.

That being said, if you wanted to do a Whois lookup for any domain name, the following would need to happen in your script or tool:

  1. Connect to whois.iana.org on Port 43 via TCP.

  2. Send the following input: tld\r\n, where tld is replaced with the domain extension (e.g. ninja).

  3. Store the data.

  4. Parse the data returned to find the link to the next Whois server in the chain.

  5. Connect to the next whois server on Port 43 via TCP if found.

  6. Send the following input: example.tld\r\n, where example.tld is replaced with the full domain name (e.g. nic.ninja).

  7. Store the data.

  8. Parse the data returned to find the link to the next Whois server in the chain, if found.

  9. Connect to the next whois server on Port 43 via TCP.

  10. Send the following input: example.tld\r\n.

  11. Store the data.

  12. Echo all the Whois data from the Whois servers.

Note that there will only ever by at most 3 Whois servers in the chain:

whois.iana.org
--> registry whois server (if found)
    --> registrar whois server (if found)

Also, some TLDs do not have a Whois server, so whois.iana.org will actually be your final stop!

So for example, a Whois lookup for nic.ninja follows this path:

whois.iana.org
--> whois.unitedtld.com

I implement this method on my own Whois lookup tool available online at http://gwhois.org/.

screenshot

iglvzx
  • 498
  • 1
  • 8
  • 22
  • You can find other strategies here also: https://unix.stackexchange.com/a/407030/211833 ; also gTLDs, except .COM/.NET/.JOBS currently, are thick so you can stop at registry whois server, there is no need to query registrar whois server. – Patrick Mevzek Jan 08 '18 at 18:46
  • And nowadays RDAP should be a better alternative, at least for gTLDs, than whois. – Patrick Mevzek Jul 14 '21 at 15:09