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:
Connect to whois.iana.org
on Port 43 via TCP.
Send the following input: tld\r\n
, where tld
is replaced with the domain extension (e.g. ninja
).
Store the data.
Parse the data returned to find the link to the next Whois server in the chain.
Connect to the next whois server on Port 43 via TCP if found.
Send the following input: example.tld\r\n
, where example.tld
is replaced with the full domain name (e.g. nic.ninja
).
Store the data.
Parse the data returned to find the link to the next Whois server in the chain, if found.
Connect to the next whois server on Port 43 via TCP.
Send the following input: example.tld\r\n
.
Store the data.
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/.
