whois – A CLI Tool To Check Information About Ownership Of A Domain Name And IP Address

whois is a command line utility that fetch information about ownership of a domain name from whois server (whois database).

WHOIS is a query and response protocol that is widely used to gather information about registered domain name.

There are many third party websites were available to check the information.

However, as a Linux administrator we should know about this utility.

If you are looking for alternative then you can give a try with jwhois command.

It’s a small geek and show you the numerous information right from your terminal.

If you are looking for DNS related records, the following URLs may help you out.

It fetches the following inflammations such as Registrant Name, Registrant Contact Details, Registrant Country, Registrar Info, Domain Created Date, Domain Expiry Date and Name Server Information, etc,.

There are many domain extensions were available in the market and it’s split based on the hierarchy.

The following two top level domains are very famous, the top-level domains (TLDs) which includes generic top-level domains (gTLD) such as .com, .info, .net, edu, and .org, and the country code top-level domains (ccTLDs) such as .in, .us, .nz etc,.

A fully qualified domain name (FQDN) looks like www.2daygeek.com..

The hierarchy of fully qualified domain name looks like below.

.		----> Root Level
|		 
com		----> Top Level Domains (TLDs)
|
2daygeek	----> Second Level Domains
|
support		----> Sub-Domain Of Parent

How To Install whois Command In Linux?

This isn’t pre-installed on your system and it’s available in most of the distribution repository. Hence, we can easily install it.

For Fedora system, use DNF Command to install whois.

$ sudo dnf install whois

For Debian/Ubuntu systems, use APT-GET Command or APT Command to install whois.

$ sudo apt install whois

For Arch Linux based systems, use Pacman Command to install whois.

$ sudo pacman -S whois

For RHEL/CentOS systems, use YUM Command to install whois.

$ sudo yum install whois

For openSUSE Leap system, use Zypper Command to install whois.

$ sudo zypper install whois

How To Check Domain Information Using whois Command In Linux?

To get information about ownership of domain and other information’s, run the following command.

# whois 2daygeek.com

Domain Name: 2DAYGEEK.COM
Registry Domain ID: 1828363680_DOMAIN_COM-VRSN
Registrar WHOIS Server: whois.syrahost.com
Registrar URL: http://www.crazydomains.com
Updated Date: 2014-08-22T00:31:39Z
Creation Date: 2013-09-21T00:00:00Z
Registrar Registration Expiration Date: 2023-09-21T00:00:00Z
Registrar: CRAZY DOMAINS FZ-LLC
Registrar IANA ID: 1291
Registrar Abuse Contact Email: [email protected]
Registrar Abuse Contact Phone: +61.894220890
Reseller: CRAZY DOMAINS
Domain Status: ok https://icann.org/epp#ok
Registry Registrant ID: R-014680853-SN
Registrant Name: MAGESH MUTHU
Registrant Organization: 
Registrant Street: NO.5, SECOND FLOOR, TRUSTPURAM, PULIYUR MAIN ROAD,KODAMBAKKAM
Registrant City: CHENNAI
Registrant State/Province: TAMILNADU
Registrant Postal Code: 600024
Registrant Country: IN
Registrant Phone: +91.9600106327
Registrant Phone Ext: 
Registrant Email: [email protected]
Registry Admin ID: C-004194513-SN
Admin Name: MAGESH MARUTHAMUTHU
Admin Organization: 
Admin Street: NO.5, SECOND FLOOR, TRUSTPURAM, PUILYUR MAIN ROAD, KODAMBAKKAM
Admin City: CHENNAI
Admin State/Province: TAMILNADU
Admin Postal Code: 600024
Admin Country: IN
Admin Phone: +91.9600106327
Admin Phone Ext: 
Admin Email: [email protected]
Registry Tech ID: C-004194513-SN
Tech Name: MAGESH MARUTHAMUTHU
Tech Organization: 
Tech Street: NO.5, SECOND FLOOR, TRUSTPURAM, PUILYUR MAIN ROAD, KODAMBAKKAM
Tech City: CHENNAI
Tech State/Province: TAMILNADU
Tech Postal Code: 600024
Tech Country: IN
Tech Phone: +91.9600106327
Tech Phone Ext: 
Tech Email: [email protected]
Name Server: JEAN.NS.CLOUDFLARE.COM
Name Server: VIN.NS.CLOUDFLARE.COM
DNSSEC: unsigned
URL of the ICANN WHOIS Data Problem Reporting System: http://wdprs.internic.net/
>>> Last update of WHOIS database: 2014-08-22T00:31:39Z <<<

How To Check IP Address Information Using whois Command In Linux?

To get information about ownership of given IP address and other information's, run the following command.

# whois 103.5.134.181
% [whois.apnic.net]
% Whois data copyright terms    http://www.apnic.net/db/dbcopyright.html

% Information related to '103.5.132.0 - 103.5.135.255'

% Abuse contact for '103.5.132.0 - 103.5.135.255' is '[email protected]'

inetnum:        103.5.132.0 - 103.5.135.255
netname:        BBNL-IN
descr:          BANGALORE BROADBAND NETWORK PVT LTD
descr:          100 Ag's colony 4th Main road
descr:          Anandnagar
country:        IN
admin-c:        BBNP1-AP
tech-c:         BBNP1-AP
mnt-by:         MAINT-IN-IRINN
mnt-lower:      MAINT-BBNL-IN
mnt-routes:     MAINT-BBNL-IN
mnt-irt:        IRT-BBNL-IN
status:         ALLOCATED PORTABLE
last-modified:  2013-01-16T03:53:44Z
source:         APNIC

irt:            IRT-BBNL-IN
address:        100 Ag's colony, 4th main road
e-mail:         [email protected]
abuse-mailbox:  [email protected]
admin-c:        BBNP1-AP
tech-c:         BBNP1-AP
auth:           # Filtered
mnt-by:         MAINT-BBNL-IN
last-modified:  2017-12-01T04:58:58Z
source:         APNIC

role:           BANGALORE BROADBAND NETWORK PVT LTD - network admi
address:        100 Ag's colony, 4th main road
country:        IN
phone:          +91-9980947375
e-mail:         [email protected]
admin-c:        BBNP1-AP
tech-c:         BBNP1-AP
nic-hdl:        BBNP1-AP
mnt-by:         MAINT-BBNL-IN
last-modified:  2010-12-21T05:40:28Z
source:         APNIC

% Information related to '103.5.132.0/22AS55947'

route:          103.5.132.0/22
descr:          ip pool of 103.5.132.0/22 for BBNL
origin:         AS55947
country:        IN
notify:         [email protected]
mnt-lower:      MAINT-BBNL-IN
mnt-routes:     MAINT-BBNL-IN
mnt-by:         MAINT-BBNL-IN
last-modified:  2011-11-24T05:53:50Z
source:         APNIC

% This query was served by the APNIC Whois Service version 1.88.15-46 (WHOIS-JP4)

How To Check Multiple Domains Expiry Date Using Shell Script?

If you have multiple domains and want to check those expiry date. I would advise you to use the following small shell script.

Shell script for domain expiry date check.

# vi whois-check.sh

#!/bin/bash
# List You Domain Here
DOMAINS="2daygeek.com linuxtechnews.com"
for domain in $DOMAINS
do
  echo -n "$domain - "
  whois $domain | grep 'Expiration' | awk '{print $3,$4,$5}'
  echo ""
done

Set an executable permission to whois-check.sh file.

# chmod +x whois-check.sh

Finally run the script to achieve this.

# sh whois-check.sh

2daygeek.com       -  Expiration  Date:  2023-09-21T00:00:00Z
linuxtechnews.com  -  Expiration  Date:  2020-05-19T04:16:10Z

About Magesh Maruthamuthu

Love to play with all Linux distribution

View all posts by Magesh Maruthamuthu

2 Comments on “whois – A CLI Tool To Check Information About Ownership Of A Domain Name And IP Address”

  1. 951024 832169 There are some fascinating points in time in this write-up but I dont know if I see all of them center to heart. There is some validity but I will take hold opinion until I appear into it further. Excellent write-up , thanks and we want a lot more! Added to FeedBurner as properly 220704

Leave a Reply

Your email address will not be published. Required fields are marked *