How to use the whois command on Ubuntu Linux

Whois is a command-line utility used in Linux systems to retrieve information about domain names, IP addresses, and network devices registered with the Internet Corporation for Assigned Names and Numbers (ICANN). The data received by Whois consists of the name and contact information of the domain or IP address owner, the registration and expiration date, the domain registrar, and the server information. Whois command can be very useful for network administrators, web developers, and security professionals for achieving various tasks like checking network connectivity or troubleshooting. In this article, we will go through the usage of the Whois command on Linux (Ubuntu system).

Installing Whois Command on Ubuntu

Follow the below number of steps to install the Whois command on Ubuntu. 

Step 1: Firstly, update the system using the below command. Execute the below command in the terminal to update the system. 

sudo apt update

 

Step 2: Now, by using the apt manager, install the whois command utility, so that we can retrieve the information about domains, IP Addresses, etc.

sudo apt install whois

 

Usage of Whois Command on Ubuntu

Example 1: Getting Information on Domain Name (w3wiki.net).

In this example, we will extract the information about the domain (w3wiki.net). In the below screenshot, you can see that we have information like Registry Domain ID, WHOIS Server, Updated Date, etc. 

whois w3wiki.net

 

Some information is kept private due to security issues. As you can see in the below screenshot, information like Phone, Fax, Postal Code, etc information is kept private.

 

Example 2: Getting Information about IP Address.

In this example, we will be extracting information by giving the IP Address as input to the whois command. In the below screenshot, we have got the information about the IP Address such as NetRange, CIDR, etc. 

whois 8.8.8.8

 

In the below screenshot, detailed information is shown such as OrgTechName, OrgTechPhone, OrgTechEmail, etc. This information can be helpful to diagnose the network connections and also to troubleshoot the network. 

 

Example 3: Getting Information about some specific WHOIS server set up by an ICANN.

WHOIS command is not limited to standard domain or IP address, even we can extract the information of some specific WHOIS server set up by an ICANN. In the below screenshot, we have given the input of the WHOIS Server along with the domain name. We have got the detailed information for this.

whois -h whois.verisign-grs.com google.com

 

Example 4: Getting  Information about a domain name from a specific registrar.

In this example, we will fetch the information about a domain name from a specific registrar. We have given the domain name (whois.iana.org) and the registrar (com).

whois -h whois.iana.org com

 

Uninstalling Whois Command on Ubuntu

After usage, we can remove the command by uninstalling it. Execute the below command in the terminal to remove the whois command from Ubuntu.

sudo apt remove whois

 

Conclusion

In conclusion, the whois command is a useful tool for obtaining information about domain names, IP Addresses, and network devices registered with ICANN. Whois command is a simple and powerful tool that can be useful for network administration, web development, and security tasks, and every Linux user should be familiar with its usage. In this article, we have gone through the installation of the whois command and its usage in the form of examples.