How To WHOIS From a Windows Command Prompt
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:
- Downloaded Whois utility
- Extract the archive into a folder
- 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:
- Open a Windows command prompt
whois -v example.com
- 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.
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:
- Open a Terminal window
whois example.comat the command prompt
- 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:
- Open a shell to access the command prompt
- 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
Do you have any special uses for Whois or other DNS utilities such as dig and Nslookup? Please let us know in the comments!