How To WHOIS From a Windows Command Prompt

Posted by Jamie on May 7, 2019

Have you ever wondered who owns a particular domain name? Have you ever wanted to purchase a domain name and wanted to know if the domain was available?

Every domain name (e.g., techjunkie.com) is owned by a person, company, or organization. When the domain purchaser registers the domain name, they enter their contact information into a database called a database of Top Level Domains (TLD’s) such as .com, .net, and .org domains

However, many domain owners turn on privacy protection so that their contact information isn’t publically available. Most domain name registrars (usually hosting companies) offer privacy protection for a small fee.

In addition to using the Whois to look up domain name ownership, you can also look up the same sort of information about IP addresses, which would mostly be useful for system and network administrators

The official interface to the Whois Database is the ICANN Whois. Try looking up a domain name such as microsoft.com using the ICANN Whois and you’ll get output that looks like this:

Surprise, microsoft.com is owned by the Microsoft Corporation. Note that there are three different types of contacts – the actual registrant, the administrative contact, and the technical contact. The Whois is a critical tool for many web developers, designers, IT consultants, and entrepreneurs.

Usually, when someone wants to look up a domain they use a web tool such as ICANN Whois or another free online interface to the Whois database. However, if you’re in a line of work, finding yourself making frequent Whois queries, you will want a more convenient and efficient method for making Whois queries. That’s where the whois utility available for Windows and built right into MacOS and Linux systems.

Microsoft makes a Whois utility available as part of the Windows Sysinternals toolkit, a suite of tools for server and network administrators, and as a free stand-alone Whois utility that runs on Windows  Client Vista and higher, Windows Server 2008 and higher, and on Nano Server 2016 and higher. Windows Whois is simple to download and use:

  1. Downloaded Whois utility
  2. Extract the archive into a folder
  3. Then extract the executable file to a directory in your system path

Run WHOIS from a Windows command prompt

Windows Whois is a simple executable so there’s no need to install anything:

    1. Open a Windows command prompt
    2. Type whois -v example.com
    3. Whois will return the output to the terminal

Because this is a text-based service, there will be something of a “wall of text” output from your whois program, but in that listing you will see all the same information as you would see from a web-based search: who owns the domain, when it was registered and who with, when it is due for renewal, who the domain is registered to and all sorts of other information about that domain.

To make the Whois output easier to read, redirect its output to a text file that you can then scroll through using a common text editor such as Notepad or Notepad++. Here’s how to write the Whois output to a text file.

From the command prompt, simply type the following (replacing example.com with the domain you’d like to query):

whois -v example.com > example.txt

What does the Whois output mean?

Some of the data included in a Whois query is obvious: The registrant name, address, contact email, phone and so on. But what about the rest?

  • The Registrar is the company with whom the domain owner registered the domain
  • The Creation Date is when the domain was first registered
  • The Expiration Date is when the domain registration expires
  • The Administrative Contact for the domain is often the website administrator for the domain
  • Name Servers indicate which hosting company hosts the domain name

Why would you need to run Whois?

The first step in registering a new domain name is to determine if the domain you want is available or if someone’s already registered it. If the Whois query doesn’t find the domain name then you can register it right away. If someone already owns the domain, then you’ll either have to choose another domain or contact the owner about purchasing the domain.

You might want to look up when a domain expires, what nameservers are handling the DNS hosting, or you might want to find who the hosting service is so you can lodge a complaint. You may even like a domain name enough to contact the owner about purchasing the domain, though domain owners often charge a premium.

If you change web or email hosting, you will want to query the Whois to find the name servers that will tell you where the domain is hosted.

When you migrate your website and email to a new hosting service, you will need to update the name servers to point at your new hosting service then verify that the name server changes took effect. These are tasks for which you will find the Whois utility an essential part of your toolkit.

How to WHOIS from a Windows command prompt3

Running Whois in Mac or Linux

Of course, it isn’t just Windows users who would ever run Whois. Windows users just need to add the specific tool to do it; MacOS and Linux have a Whois utility built into the system and ready to use. Utilities like Whois are installed by default.

Running Whois on MacOS

To run a Whois query on a Mac, just follow these steps:

  1. Open a Terminal window
  2. Type whois example.com at the command prompt
  3. Press Enter

You should see much the same result as in the Windows example above.

Running Whois on Linux

Running Whois on Linux is almost identical to running it on macOS terminal:

  1. Open a shell to access the command prompt
  2. Type whois example.com
  3. Press Enter

You will also see the same kind of entry as Windows and Mac users.

If the macOS or Linux whois data scrolls by too quickly you can pipe the output to paging utility to scroll through the data at your own pace:

whois example.com | less

If you want to learn more about Whois see How To Tell Who Owns a Domain Using Whois.  If you’re a MacOS user, you might find, How to flush your DNS cache on MacOS useful.

Do you have any special uses for Whois or other DNS utilities such as dig and Nslookup? Please let us know in the comments!

4 thoughts on “How To WHOIS From a Windows Command Prompt”

Drunken Shitgibbon says:
What’s wrong with adding a folder to your PATH?
Rey says:
Drop all the files in c:/windows/system32 so that the commands are global and not have to change directory to where the files are
ducat1ss says:
You will need to download Sysinternals Suite from Microsoft
Pranav Satish Totala says:
Why is it not running in my windows 10. Tried in both Cmd prompt and PowerShell. Says command not found. tried the whois64 too. Do i need to DW any application or library for this command? What is the path for this command?
Carrie says:
I just figured this out. You have to cd into the same location as the file. If you downloaded whois.exe to your desktop, you’d need to do the command:
cd C:\Users\username\Desktop
Once you’re there, you can do whois domain.com and it’ll run it.

Leave a Reply to Pranav Satish Totala Cancel reply

