Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Whois list of Top Level Domain against their corresponding registrar

Tags:

tld

whois

I'm trying to find a list of TLD's to their corresponding whois server, for example

.com americanWhoisServer .net someOtherWhoisServer .au australianWhoisServer

In the end i'm aiming for something like a Dictionary where the key is the TLD and the value is the whois server address (eg whois.apnic.net).

Ah snap, i just realised that i am given the IP addresses and not domain names but a list could still come in handy.

How can i determine which whois server to use given a IP address? Guess and check?

like image 213
Daniel Avatar asked Oct 22 '25 00:10

Daniel


2 Answers

You can get the official (?) tld list from http://data.iana.org/TLD/tlds-alpha-by-domain.txt and then query the IANA whois server (whois.iana.org at port 43) for each tld to get information about it. Slightly more export-friendly and official than the HTML tld list at http://www.iana.org/domains/root/db/.

like image 98
Halil Özgür Avatar answered Oct 29 '25 21:10

Halil Özgür


Do not use a static, local list; whois servers may change in time (ok, not everyday, but it may happen); to find the server for a given domain or ip, start by querying the IANA whois server, basically, connect to whois.iana.org:43 and send the query string followed by "\r\n"; for example "ibm.com\r\n" or "72.163.5.201\r\n", the IANA whois server will then return an answer containing a "hint", for example, the query for 72.163.5.201 would return

% IANA WHOIS server 
% for more information on IANA, visit http://www.iana.org 
% This query returned 1 object

refer: whois.arin.net

inetnum: 72.0.0.0 - 72.255.255.255 organisation: ARIN status: ALLOCATED

whois: whois.arin.net

changed: 2004-08 source: IANA

now, parse the response searching for the "whois:" entry, extract the name of the whois server responsible for the IP or domain (whois.arin.net in this case) and repeat the query using that server; notice though, that in some cases (e.g. "com" domains and the verisign whois server) the second answer you'll get may return a referral to another whois server for example, here's the result of a query against the verisign whois for the verisign.com domain will return

Domain Name: VERISIGN-GRS.COM
Registrar: CSC CORPORATE DOMAINS, INC.
Sponsoring Registrar IANA ID: 299
Whois Server: whois.corporatedomains.com
Referral URL: http://www.cscglobal.com/global/web/csc/digital-brand-services.html
Name Server: AV1.NSTLD.COM
Name Server: AV2.NSTLD.COM
Name Server: AV3.NSTLD.COM
Name Server: AV4.NSTLD.COM
Status: clientTransferProhibited https://www.icann.org/epp#clientTransferProhibited
Status: serverDeleteProhibited https://www.icann.org/epp#serverDeleteProhibited
Status: serverTransferProhibited https://www.icann.org/epp#serverTransferProhibited
Status: serverUpdateProhibited https://www.icann.org/epp#serverUpdateProhibited
Updated Date: 12-jan-2016
Creation Date: 08-sep-2000
Expiration Date: 08-sep-2016

in such a case you'll need to locate the "Whois Server:" line, extract the whois server name (whois.corporatedomains.com in this case) and repeat the query; a last caveat, in some cases the "referral" may be returned even if the server is the one you just queried, so you should check such a condition to avoid an infinite loop

like image 34
grayhat Avatar answered Oct 29 '25 20:10

grayhat



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!