If I had a domain name, and wanted to find the registrar and the hosting company for that domain, how do I do that? Is there any central registry that keeps track of it? If yes, is there any API to query that database?

Same way, how to find out the web host?


You can find the domain registrar by querying the WHOIS database(s). There are actually multiple databases, depending on the Top Level Domain (TLD). For example, .com and .net are handled by Verisign. There are a handful of RFCs that describe how to query this information, along with a number of available tools that can act as a front-end for you.

For example, if you have access to a Unix or Linux command line, you can use the whois command:

$ whois example.com

Whois Server Version 2.0

Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for detailed information.

   Domain Name: EXAMPLE.COM
   Whois Server: whois.iana.org
   Referral URL: http://res-dom.iana.org
   Name Server: A.IANA-SERVERS.NET
   Name Server: B.IANA-SERVERS.NET
   Status: clientDeleteProhibited
   Status: clientTransferProhibited
   Status: clientUpdateProhibited
   Updated Date: 26-mar-2004
   Creation Date: 14-aug-1995
   Expiration Date: 13-aug-2011

Last update of whois database: Mon, 01 Nov 2010 16:21:30 UTC

[. . .]

The Registry database contains ONLY .COM, .NET, .EDU domains and
% IANA WHOIS server
% for more information on IANA, visit http://www.iana.org
% This query returned 1 object

domain:       EXAMPLE.COM

organisation: Internet Assigned Numbers Authority

created:      1992-01-01
source:       IANA

If you don't have access to a Unix/Linux command line, you can use a large number of online web interfaces to the WHOIS database. Googling for 'whois' will turn up numerous options.

Finding the webhost for a website is significantly more difficult. You can find out who owns the IP address space using the same whois command as above, and querying the appropriate IP database. For example, to look up, I might do:

$ whois
# Query terms are ambiguous.  The query is assumed to be:
#     "n"
# Use "?" to get help.

# The following results may also be obtained via:
# http://whois.arin.net/rest/nets;q=

NetRange: -
NetHandle:      NET-192-168-0-0-1
Parent:         NET-192-0-0-0-0
NetType:        IANA Special Use
NameServer:     BLACKHOLE-1.IANA.ORG
NameServer:     BLACKHOLE-2.IANA.ORG
Comment:        This block is used as private address space.
Comment:        Addresses from this block can be used by
Comment:        anyone without any need to coordinate with
Comment:        IANA or an Internet registry. Addresses from
Comment:        this block are used in multiple, separately
Comment:        operated networks.
Comment:        This block was assigned by the IETF in the
Comment:        Best Current Practice document, RFC 1918
Comment:        which can be found at:
Comment:        http://www.rfc-editor.org/rfc/rfc1918.txt
RegDate:        1994-03-15
Updated:        2010-03-15
Ref:            http://whois.arin.net/rest/net/NET-192-168-0-0-1

OrgName:        Internet Assigned Numbers Authority
OrgId:          IANA
Address:        4676 Admiralty Way, Suite 330
City:           Marina del Rey
StateProv:      CA
PostalCode:     90292-6695
Country:        US
Updated:        2004-02-24
Ref:            http://whois.arin.net/rest/org/IANA

OrgTechHandle: IANA-IP-ARIN
OrgTechName:   Internet Corporation for Assigned Names and Number
OrgTechPhone:  +1-310-301-5820
OrgTechEmail:  abuse@iana.org
OrgTechRef:    http://whois.arin.net/rest/poc/IANA-IP-ARIN

OrgAbuseHandle: IANA-IP-ARIN
OrgAbuseName:   Internet Corporation for Assigned Names and Number
OrgAbusePhone:  +1-310-301-5820
OrgAbuseEmail:  abuse@iana.org
OrgAbuseRef:    http://whois.arin.net/rest/poc/IANA-IP-ARIN

# ARIN WHOIS data and services are subject to the Terms of Use
# available at: https://www.arin.net/whois_tou.html

However, that just tells you who owns the IP address space, and is not a guarantee of anything else. That address space might belong to a company that hosts their own web server, or it might belong to a hosting company that hosts a website for someone else (or multiple websites on that IP, for multiple customers). Additionally, the IP address space might be owned by an ISP, and leased/used by a company. Many, many options, and very little certainty, for this.

  • whois just opens a TCP connection to port 43, sends a one line command and gets back a blob of text as reply. – Patrick Mevzek May 6 '18 at 3:08
  • You can start by querying th IANA whois server at whois.iana.org to find the appropriate whois server for a TLD. There are various other tricks to do that, based on DNS queries. – Patrick Mevzek May 6 '18 at 3:09

The easiest way to find the registrar would be going to the following website. http://whois.domaintools.com/

To find the host usually means running a traceroute to the IP address of the website from command line or linux/mac shell such as.

tracert www.websitename.com or traceroute www.website.com

this is not always 100% since the web host may not be the same host as the database and in addition not always guarantee of hitting the target in the event its reaching a CDN.

these should help get you started however, best of luck.

  • oh okay, I can't try this now, I am on windows. Need to go home to try it on Linux. Is there no central database/registry that I can query? – user187809 Nov 1 '10 at 16:25
  • You can run tracert from a Windows Command Prompt. The Command Prompt is accessed by Start > Run > cmd.exe – Daniel Mallott Nov 1 '10 at 16:38

I'd like to provide an alternate way to query WHOIS data. Doing it in the browser is becoming more frustrating, due to having to pass CAPTCHAs just to see the information you requested.

I wrote a blog post recently on how you can query WHOIS data from the Command Prompt on Windows.

  1. Download the WHOIS Tool from Microsoft;
  2. Extract the contents of the zip to your C:\ drive;
  3. Create a System Variable with the Name: WHOIS and a value of: C:\whois.exe;
  4. OK out of all the dialogs you just opened to create the System Variable;
  5. Open the Command Prompt and enter: %whois% google.com

The details will be displayed.

  • Why bother creating the variable? Just call c:\whois.exe directly – ivanivan May 6 '18 at 4:11
  • 1
    @ivanivan The point is to make it as less tedious [by reducing the number of typed characters] as possible and to not have to remember where everything is stored. Hence the reason for the variable. Also, I find your comment pretty counterproductive. I offered a solution that is quicker and you're complaining about something that actually saves the person time? – Jay May 6 '18 at 4:19
  • Then drop the binary in your system path and then simply run whois example.com - fewer characters, and set up the way it actually works on all of the other operating systems. No need to complicate things by using an environmnet variable that uses 2 characters that aren't typed that often... – ivanivan May 6 '18 at 12:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.