Linux online course

whois Command in Linux: Look Up Domain Registration Information

Learn how to install and use the Linux whois command to inspect domain registration records, interpret common fields, follow referrals, and understand privacy limitations.

The Linux whois command queries public registration records. You can use it to investigate domain names and, depending on the service, IP addresses or autonomous system numbers (ASNs).

Domain results may include the registrar, registration dates, authoritative nameservers, domain status codes, and registrant-related contact data. The exact response depends on the registry, registrar, top-level domain (TLD), privacy settings, and applicable data-protection rules.

What WHOIS Means

WHOIS is a distributed query service and protocol for retrieving registration information from domain registries, registrars, and network registries. A registry operates the database for a TLD or another address-registration space. A registrar is an accredited company that registers and manages domain names for registrants.

A registrant is the person or organization recorded as the domain registration holder. Public results may hide this information or replace it with a privacy/proxy service.

A top-level domain (TLD) is the final portion of a domain name, such as .com, .org, or a country-code TLD. WHOIS can also be used for some IP address and ASN queries, but the available fields and response format vary by network registry.

Install and Verify whois

The package may not be installed by default. Install it with the package manager used by your distribution.

Debian and Ubuntu

sudo apt update && sudo apt install whois

Fedora and RHEL-family systems

sudo dnf install whois

Arch Linux

sudo pacman -S whois

Verify that the executable is available:

command -v whois
whois --help

The first command prints the executable path when whois is in your PATH. The second displays help information. Some implementations support a version option, but help output is more consistently useful for checking availability.

Basic Domain Lookup

The basic syntax is:

whois DOMAIN

For a safe documentation example, query example.com:

whois example.com

The response is live data and can change. Do not expect every field, value, or formatting detail to remain constant.

Common WHOIS Fields

WHOIS labels are not universal. A field may appear under a slightly different name, be repeated for different services, or be absent entirely.

Field label: Registrar
Meaning: The accredited company through which the registration is managed.
Notes and limitations: This is not necessarily the same organization as the registry.

Field label: Registry Domain ID
Meaning: An identifier assigned to the domain within a registry.
Notes and limitations: It is useful for registry records but is not a person's identity.

Field label: Creation Date or Registered On
Meaning: When the domain registration was originally created.
Notes and limitations: Date formats and time zones vary; a transfer may not change the original creation date.

Field label: Updated Date
Meaning: When registration record information was last changed.
Notes and limitations: An update can reflect administrative changes and does not necessarily mean the website changed.

Field label: Registry Expiry Date or Expiration Date
Meaning: The scheduled end of the current registration term if it is not renewed.
Notes and limitations: Renewal grace and redemption periods can affect what happens after this date.

Field label: Name Server or Nameserver
Meaning: A DNS server delegated to provide authoritative DNS data for the domain.
Notes and limitations: Nameservers show where authoritative DNS is hosted, not who necessarily controls the domain.

Field label: Domain Status
Meaning: A registry or registrar state code affecting transfer, updates, deletion, or resolution behavior.
Notes and limitations: Codes such as transfer locks or pending actions require context; read all listed statuses.

Field label: Registrant
Meaning: The recorded domain holder.
Notes and limitations: The value may be redacted, omitted, or replaced by a privacy/proxy provider.

Field label: Administrative Contact
Meaning: A contact role for administrative matters.
Notes and limitations: It may be hidden, combined with another role, or represented by a service provider.

Field label: Technical Contact

Meaning: A contact role for technical matters such as DNS or service operation.
Notes and limitations: It may be redacted or absent; it does not prove who operates a website.

Authoritative DNS and nameservers

Authoritative DNS is the DNS data served by the nameservers officially delegated for a domain. If WHOIS lists ns1 and ns2 hosts, those nameservers are the delegation targets for DNS administration. WHOIS does not by itself show every DNS record; use a DNS tool such as dig when you need to inspect records.

Useful whois Options

Option: -H
Purpose: Suppress legal disclaimer text from many WHOIS responses.
Example: whois -H example.com

Option: -h HOST
Purpose: Send the query to a specific WHOIS server.
Example: whois -h whois.example-registry.test example.test

The -H option does not guarantee a short response. The remote WHOIS service controls the response structure and may still return extensive notices or record data.

Following Referrals and Choosing a Server

A registry response may include a referral to the WHOIS server operated by the sponsoring registrar. Registry-level information generally comes from the TLD registry and may include delegation, status, and registry dates. Registrar-level information may provide additional registration or contact details.

When a response identifies a specific server, query it with -h:

whois -h whois.example-registry.test example.test

The hostname above is a syntax demonstration. Use the actual server named by a live response or documentation from the relevant registry or registrar.

Save and Search Lookup Results

Redirect the response to a text file for later review:

whois example.com > example.com.whois.txt

Search for common labels with grep:

whois example.com | grep -Ei 'registrar|name server|nameserver|creation date|expiry date|expiration date|domain status'

This is convenient for interactive work, but it is not a universal parser. TLDs and registrars use different labels, capitalization, layouts, and date formats. Always inspect the raw response when a field is missing or when accuracy matters.

Privacy, Accuracy, and Other Limitations

  • Modern WHOIS output often hides personal names, addresses, telephone numbers, and email addresses through redaction or privacy/proxy services.
  • A listed privacy provider or registrar may identify the service handling public contact information rather than the actual domain holder.
  • WHOIS records are not proof of current ownership, authorization, identity, or malicious activity. Treat them as public registration data, not as a complete investigation.
  • Some registries return incomplete records, limit query frequency, or refer queries to another WHOIS server.
  • Some registration systems use RDAP, the Registration Data Access Protocol, instead of or alongside WHOIS. RDAP is a newer standardized, web-based way to access registration data.

WHOIS Result Caveats

Situation: Redacted registrant fields
What it means: The registry or registrar has removed personal data from the public response.
Recommended interpretation: Only the visible public record can be relied upon.

Situation: Privacy/proxy contact
What it means: A service has substituted its own contact details.
Recommended interpretation: Do not treat the service's identity as the underlying registrant's identity.

Situation: Registrar referral
What it means: The registry directs you to the sponsoring registrar for more detail.
Recommended interpretation: Follow the referral or query the named host with -h where appropriate.

Situation: No match response
What it means: The queried service found no record in its database, or the query format or server was unsuitable.
Recommended interpretation: Check the domain spelling and the responsible registry or registrar.

Situation: Rate-limited query
What it means: The remote service is limiting requests or applying access controls.
Recommended interpretation: Reduce query frequency and follow the provider's usage policy.

Situation: Different field labels by TLD
What it means: Registries and registrars format records differently.
Recommended interpretation: Read the complete response and account for alternate labels such as Registry Expiry Date.

Troubleshooting

“whois: command not found”

The package is probably not installed, or the executable is not in your PATH. Install the distribution package and run:

command -v whois

Contact information is missing

Redaction or a privacy/proxy service is the usual cause. Treat the response as the public record; a normal WHOIS query does not reveal hidden registrant details.

The response contains only a referral

The registry may delegate detailed information to the sponsoring registrar. Follow the displayed referral or use the referred host with -h.

A script cannot find “Expiration Date”

Inspect the raw output and support alternate labels such as Registry Expiry Date. Avoid assuming that one regular expression or field name works for every TLD.

Requests are refused or output becomes incomplete

The service may be rate-limiting requests. Reduce the request frequency, review its usage policy, and consider an approved RDAP endpoint or service for programmatic access.

The domain appears expired but still resolves

An expiration date does not describe the entire domain lifecycle. Renewal grace periods, redemption periods, and existing DNS configuration can affect behavior. Check domain status and registrar information rather than assuming that DNS stops immediately on the listed date.

Practical Interpretation Checklist

  1. Confirm that you queried the intended domain and understand which TLD registry is involved.
  2. Identify the registrar and determine whether the response is registry-level, registrar-level, or both.
  3. Record the creation, updated, and expiry dates, noting the displayed time zone and label.
  4. Review every domain status code instead of relying on a single status.
  5. Compare nameservers with the DNS service you expect to be authoritative.
  6. Interpret contact fields cautiously because they may be redacted or privacy-protected.
  7. Save the raw response when you need an auditable snapshot, while remembering that it can become outdated.