Using whois command in Linux


Whois command in Linux searches in a WHOIS database. This database stores the registered users of an internet resource such as domain name, IP address, etc. Running a whois command queries and fetches the required information from this database.

In this article, we will discuss the usage of the whois command in Linux.

How to install whois in Linux

In some Linux distribution, you may find it pre-installed. But if it is not in your system you can use one of the given commands to install it –

To install whois on Debian/ Ubuntu/ Linux Mint etc use –

sudo apt install whois

Or if you are using RHEL/CentOS then use –

sudo yum install whois

In Fedora use –

sudo dnf install whois

If you want to install it on an Arch Linux based distro use –

sudo pacman -Syu whois

Once it gets successfully installed on your system you can start using it.

Querying a domain name with whois command

We can use the whois command to query a domain name or IP address. The simplest form of using the whois command is given below –

whois domain_name

For example –

whois google.com

You can see the output of this command in the given image –

There are certain options available that you can use with the whois command. The detailed syntax of using the whois command is given on its manual page.

Execute the following command in your terminal to view the man page of whois command –

man whois

Some important terms related to the domain are –

Domain name registry – It is a database of domains and associated registrant information

Registrant – Is the person or group who is the legal owner of the domain name

Registrar – A domain name is registered through a registrar

The output of this command also includes information such as availability, creation, expiration details, and nameservers, etc.

Querying an IP address with whois command

You can find the information related to an IP address by using the whois command. Use the following command to querying an ip address –

whois 8.8.8.8

This will display the output as given in the image –

You can see the full output of this command by scrolling it. Here you will see the details like person or organization name, address, registration date, etc.

Conclusion

Now you know how to find the information of a domain name or IP address. If you have a query related to this then write us in the comments below.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.