How to Use Whois: Beginner's Guide to Domain Lookups in Kali Linux
Learn how to use whois in Kali Linux: look up any domain, IP or AS number, read the record, and spot red flags — with a worked example and cheat sheet.
What Is Whois?
Whois is a public lookup service that tells you who registered a domain name, when it was registered, which registrar manages it, and which name servers answer for it. You type one command, whois example.com, and the registry answers with the domain's registration record — no account, no API key, no interaction with the target's own servers.
Every registered domain leaves a data trail — ownership details, registration dates, name servers — stored in public databases that anyone can query. This intelligence reveals organizational affiliations, infrastructure relationships, and potential attack vectors that would otherwise remain hidden. For a penetration tester or OSINT researcher, whois is almost always the very first command run against a target domain: it is 100 percent passive, it queries a third-party database rather than the target's infrastructure, and it takes seconds.
A Short History of Whois
Whois began in 1982 as NICNAME, a simple directory service defined in RFC 812 that ran on TCP port 43. The current specification is RFC 3912, and the protocol has barely changed since: a client opens a connection to a whois server, sends a domain name or IP address, and receives a plain-text record back. What changed is the world around it — privacy law, the rise of RDAP, and the sheer number of registrars — so a modern whois workflow needs to know where the data comes from and what it no longer shows.
Where the Answer Comes From
A whois query follows a chain of referrals:
.com and .net, Public Interest Registry runs .org.The Debian whois client follows this chain automatically. It asks IANA, follows the pointer to the registry, then to the registrar, and prints each record back to back. That is why one short command can return three records for a single domain.
Thick vs Thin Registries
Some registries are thick: they store the full registrant record themselves (.org, .info, most country-code TLDs). Others are thin: the registry stores only the registrar and name servers, and the registrant details live with the registrar (.com, .net). With a thin registry you will see two records — the registry's short record, then the registrar's fuller one. If the second record is missing or redacted, you are looking at privacy protection or a GDPR redaction, not a broken query.
How to Use Whois in 5 Steps
sudo apt install whois.whois example.com and read the record: registrar, creation date, expiry date, name servers, status codes.grep to pull out only the fields you need, for example whois example.com | grep -iE 'Registrar:|Creation Date|Name Server'.whois 8.8.8.8 for the network owner and whois AS15169 for the autonomous system behind it.dig) and the RDAP JSON record before you draw conclusions from it.Installing Whois
Whois comes pre-installed on Kali Linux. On other systems, install the same client:
# Debian / Ubuntu / Kali
sudo apt update && sudo apt install whois
# Fedora / RHEL (dnf; yum on older releases)
sudo dnf install whois
# macOS (Homebrew)
brew install whois
Windows has no built-in whois client. The two clean options are Microsoft's own Sysinternals whois.exe (download it from the Sysinternals suite and put it on your PATH) or querying RDAP with the curl that ships with Windows 10 and 11. Verify the install with:
whois --version
Whois Syntax and Core Flags
The basic form is simple:
whois [OPTION]... OBJECT
OBJECT is a domain name (example.com), an IPv4 or IPv6 address (8.8.8.8), or an AS number (AS15169). The flags that matter most in practice:
| Flag | What it does |
|---|---|
-h HOST | Query a specific whois server instead of the default one |
-p PORT | Connect to a specific port (default 43) |
-I | Query whois.iana.org first and follow its referral |
-H | Hide the legal disclaimers in the output |
-a | Search all databases (ARIN referral mode) |
-r | Disable recursive lookups (do not follow referrals) |
--no-recursion | Same as -r, in long form |
--verbose | Explain what the client is doing at each step |
-l | Find the one level less specific match (RIPE-style servers) |
-q [version|sources|types] | Ask a RIPE-style server about itself |
--help | Show all flags |
--version | Print the client version |
The exact flag set depends on your client: the Debian GNU whois client (Kali, Ubuntu) supports the flags above, while the BSD/macOS client and the Windows Sysinternals client support fewer. When a flag fails with an "unknown option" error, check whois --help on that machine before assuming the tool is broken.
Worked Example: Reading a Real Record
Run whois against the reserved example domain and read the record field by field. The output below is illustrative — real records vary by registry and registrar, and some fields are redacted — but the structure is what you will see for any .com domain:
whois example.com
Domain Name: EXAMPLE.COM
Registry Domain ID: 2336799_DOMAIN_COM-VRSN
Registrar: RESERVED-Internet Assigned Numbers Authority
Registrar IANA ID: 376
Updated Date: 2026-08-14T08:01:43Z
Creation Date: 1995-08-14T04:00:00Z
Registry Expiry Date: 2027-08-13T04:00:00Z
Name Server: ELLIOTT.NS.CLOUDFLARE.COM
Name Server: HERA.NS.CLOUDFLARE.COM
Domain Status: clientDeleteProhibited
Domain Status: clientTransferProhibited
Domain Status: clientUpdateProhibited
What each part tells you:
example.com this is IANA itself, listed as RESERVED-Internet Assigned Numbers Authority, because the domain is reserved for documentation.clientDeleteProhibited, clientTransferProhibited and clientUpdateProhibited together mean the domain is locked against deletion, transfer and modification without the owner's approval.Cross-check the same record over RDAP, the JSON successor to whois. This command works from any machine with curl:
curl -s https://rdap.verisign.com/com/v1/domain/example.com
The response is JSON with the same facts: ldhName is EXAMPLE.COM, handle is 2336799_DOMAIN_COM-VRSN, and status lists client delete prohibited, client transfer prohibited and client update prohibited. When whois and RDAP agree, you can trust the record; when they disagree, the RDAP record is usually the fresher one.
Looking Up a Domain
Basic Domain Query
# Query a domain
whois example.com
This returns the full record: registrar, dates, name servers, status codes, and registrant contact details unless privacy-protected. For a .com domain you will see two records — the registry record from Verisign, then the registrar record.
Reading the Output
Real whois output is dozens of lines long, with legal disclaimers and template text. Extract only the fields you need:
# Extract just the key fields
whois example.com | grep -E "Registrar:|Creation Date:|Registry Expiry Date:|Name Server:"
# Same fields, case-insensitive, with the expiry highlighted
whois example.com | grep -iE 'Registrar:|Creation Date|Expiry|Domain Status|Name Server'
Query by IP Address
# Find who owns an IP address
whois 8.8.8.8
A whois lookup on an IP returns the network allocation, not a domain: the address range, the organization that holds it (Google LLC for 8.8.8.8), the country, and the abuse contact. This is how you attribute an IP you found in a log file to its owner without touching the target.
Query an AS Number
# Look up the autonomous system behind an IP
whois AS15169
Pass the ASN with the AS prefix. The record shows the organization that operates the network (Google LLC for AS15169), its import/export policy summary, and the RIR that allocated it. ASN lookups are useful when a single IP tells you little but the network behind it tells you a lot — for example, when a phishing domain resolves to an ASN full of bulletproof hosting providers.
How to Read a Whois Record
| Field | What it means | Why it matters |
|---|---|---|
| Domain Name | The queried domain | Confirms you asked about the right object |
| Registry Domain ID | Unique ID in the registry | Stable across registrar changes |
| Registrar | Company that sold the domain | Points to where the registrant record lives |
| Registrar WHOIS Server | Server holding the full record | Query it directly with -h when the referral fails |
| Updated Date | Last modification of the record | A recent change on an old domain is worth noting |
| Creation Date | First registration date | Domain age is a trust signal |
| Registry Expiry Date | When registration lapses | Brand-protection and takeover monitoring |
| Name Server | Authoritative DNS servers | Reveals hosting and recent infrastructure changes |
| Domain Status | Locks and holds on the domain | ok means active with no restrictions |
| Registrant Organization | Who registered it | Often redacted — see the privacy section |
| Admin / Tech Contact | Contact emails | Often redacted; never use for unsolicited contact |
Understanding Domain Status Codes
Domain status codes indicate the current state of a domain:
| Status Code | Meaning |
|---|---|
| clientTransferProhibited | Domain cannot be transferred without owner approval |
| clientUpdateProhibited | Domain cannot be modified without owner approval |
| clientDeleteProhibited | Domain cannot be deleted without owner approval |
| serverTransferProhibited | Registry has locked the domain from transfer |
| serverUpdateProhibited | Registry has locked the domain from modification |
| serverDeleteProhibited | Registry has locked the domain from deletion |
| clientHold | Registrar has suspended the domain (often for abuse or non-payment) |
| serverHold | Registry has suspended the domain |
| ok | Domain is active with no restrictions |
| pendingDelete | Domain is scheduled for deletion |
| redemptionPeriod | Domain is in grace period before deletion |
| autoRenewPeriod | Domain was auto-renewed and is in its grace window |
A domain showing clientHold or serverHold is suspended — it will not resolve even though it is still registered. A domain in redemptionPeriod can usually still be recovered by its owner for a fee, and after that it becomes available to anyone.
Querying a Specific Whois Server
The default referral chain works for most domains, but sometimes you need to ask a specific server:
# Use Verisign's WHOIS server for .com domains
whois -h whois.verisign-grs.com example.com
# Ask ARIN directly about an IP block
whois -h whois.arin.net 8.8.8.8
# Ask RIPE directly (European allocations)
whois -h whois.ripe.net 8.8.8.8
# Start at IANA and follow the referral yourself
whois -I example.com
# Stop after the registry record (no registrar referral)
whois --no-recursion example.com
Use -h when the default routing picks the wrong upstream (rare for legacy TLDs), when you want to compare answers between regional registries, or when the registrar record is missing and you want to confirm the registry record alone. Use --no-recursion when you specifically want the registry data and not the registrar's slightly different format.
Filtering the Output
# See when a domain expires
whois example.com | grep -i "expir"
# List all name servers
whois example.com | grep -i "name server"
# Identify the registrar
whois example.com | grep -i "registrar"
# Hide the legal disclaimers for a clean read
whois -H example.com
# Save the full record for your notes
whois example.com > example-whois.txt
Combine flags and filters in one pipeline when you are checking many domains: -H removes the disclaimer block, and grep -iE with a pattern pulls the same five fields from every record so the results line up.
Checking Domain Availability and Expiry
A whois query is also the fastest availability check: if the domain is unregistered, the server answers that no match was found. Do not rely on a single "no match" — some registries return a thin answer for unregistered names, so confirm with a second source (your registrar's search page or an RDAP query) before you act on it.
# Check whether a domain is taken
whois new-brand-name-example.com | head -5
# Watch an expiry date (run weekly in a cron job or reminder)
whois example.com | grep -i "Registry Expiry Date"
For brand protection, the useful habit is a short watchlist: your brand name across .com, .net, .org and the common typos of it. A new registration of a lookalike domain, especially one created days ago with privacy protection, is the earliest warning of a phishing campaign using your brand.
Bulk Whois Lookups
Checking one domain by hand is fine; checking fifty is a script's job. Save this as bulk-whois.sh, make it executable with chmod +x bulk-whois.sh, and run it against a file with one domain per line:
#!/bin/bash
# bulk-whois.sh — summarize whois records for a list of domains
# Usage: ./bulk-whois.sh domains.txt
while read -r DOMAIN; do
[ -z "$DOMAIN" ] && continue
echo "=== WHOIS Summary for $DOMAIN ==="
echo ""
echo "Registrar:"
whois -H "$DOMAIN" | grep -i "registrar:" | head -1
echo ""
echo "Created:"
whois -H "$DOMAIN" | grep -i "creation date" | head -1
echo ""
echo "Expires:"
whois -H "$DOMAIN" | grep -i "registry expiry" | head -1
echo ""
echo "Name Servers:"
whois -H "$DOMAIN" | grep -i "name server" | sort -u
echo ""
sleep 2
done < "$1"
Two details matter: the sleep 2 between queries keeps you polite to the whois servers (aggressive bulk querying gets rate-limited or blocked), and -H strips the disclaimer text so the summary stays readable. Only ever run bulk lookups against domains you have a legitimate reason to check — your own assets, your brand watchlist, or domains inside an authorized assessment.
Whois vs Nslookup vs Dig vs RDAP
| Tool | What it answers | Best for |
|---|---|---|
whois | Who registered it, when, where | Ownership, age, registrar, status |
nslookup | What IP does this name resolve to | Quick DNS checks, interactive mode |
dig | Full DNS records with authority | DNS debugging, record types, trace |
RDAP | Same data as whois, as JSON | Scripting, automation, parsing |
host | Simple name-to-IP mapping | One-line lookups in scripts |
Whois and DNS answer different questions: whois provides domain registration information (owner, registrar, dates), while DNS provides technical records (IP addresses, mail servers, name servers). Both are essential for complete domain reconnaissance — whois tells you who owns the infrastructure, DNS tells you how it is configured.
RDAP: The Successor to Whois
RDAP (Registration Data Access Protocol) serves the same registration data as JSON over HTTPS, which makes it parseable by scripts without scraping plain text. Since January 2025, ICANN no longer requires most gTLD registries and registrars to run port-43 whois, and the same data is served over RDAP instead. The whois command still works — registries keep answering it — but for automation, prefer RDAP:
# The same example.com record as structured JSON
curl -s https://rdap.verisign.com/com/v1/domain/example.com | python3 -m json.tool | head -30
When whois and RDAP disagree, trust RDAP: it is the authoritative, machine-readable record, and it is usually updated first.
Whois for Phishing Detection
Before you click a link or trust a login page, a 30-second whois check answers three questions:
None of these is proof on its own — legitimate new domains exist, and privacy protection is normal — but a young domain plus hidden ownership plus a mismatched registrar is a strong reason to stop and verify through another channel.
Whois Privacy and GDPR
Since the GDPR took effect in 2018, registrars must redact personal data from public whois records for EU registrants, and most registrars now redact by default worldwide. You will often see REDACTED FOR PRIVACY where a name, email or phone used to appear. That is not a bug and not a reason to try another server — the data is not published anywhere public.
What still shows: the registrar, the creation and expiry dates, the name servers, and the domain status codes. Those four are enough for most reconnaissance and brand-protection work. What you can do legitimately: use the registrar's published abuse contact (usually abuse@registrar-domain) to report phishing or abuse, and use privacy-protection services from your own registrar to keep your own details out of the public record.
Whois Commands Cheat Sheet
| Task | Command |
|---|---|
| Look up a domain | whois example.com |
| Look up an IP address | whois 8.8.8.8 |
| Look up an AS number | whois AS15169 |
| Hide legal disclaimers | whois -H example.com |
| Query a specific server | whois -h whois.verisign-grs.com example.com |
| Query ARIN directly | whois -h whois.arin.net 8.8.8.8 |
| Start at IANA, follow referrals | whois -I example.com |
| Registry record only | whois --no-recursion example.com |
| Show only key fields | whois example.com | grep -iE 'Registrar:|Creation Date|Expiry|Name Server' |
| Check expiry | whois example.com | grep -i expir |
| List name servers | whois example.com | grep -i "name server" |
| Save the record | whois example.com > record.txt |
| Install on Debian/Kali | sudo apt install whois |
| Install on macOS | brew install whois |
| RDAP JSON record | curl -s https://rdap.verisign.com/com/v1/domain/example.com |
Troubleshooting Whois Problems
| Problem | Likely cause | Fix |
|---|---|---|
No whois server is known for this kind of object | TLD not recognized by the client's built-in list | Query a specific server with -h (for example, the registry's whois server) |
whois: connect: Connection timed out | Port 43 blocked by a firewall or the server is slow | Try -h against the registry server directly, or use RDAP over HTTPS |
command not found | Whois client not installed | sudo apt install whois (Kali/Debian) or brew install whois (macOS) |
| Empty output | Record fully redacted, or a thin registry with no registrar record | Query the registrar's whois server with -h, or check RDAP |
| Output is all disclaimers | The record is short and the disclaimer block dominates | Add -H to hide legal disclaimers |
whois: Unknown option | Flag not supported by this client (BSD vs GNU differ) | Run whois --help and use the flags your client supports |
| Rate-limited or blocked after bulk queries | Too many queries too fast | Add sleep 2 between queries; split large lists across sessions |
| IPv6 address returns nothing | Client queried the wrong registry for the range | Use -h against the RIR that holds the range, or query RDAP |
Common Mistakes
Best Practices
whois example.com > record.txt keeps evidence with a timestamp for your report.grep -iE for the five fields you need beats scrolling through disclaimers.Is Whois Legal?
Yes. Whois queries public registration databases, and running whois against a domain is entirely passive — you never touch the target's servers. It is legal to use for security research, brand protection, and authorized assessments. What is not legal is using the data to harass a registrant, to spam the contact addresses you find, or to support unauthorized access. Keep your queries inside your authorized scope and document why you ran them.
Summary
Whois is the fastest first step in domain reconnaissance: one command returns the registrar, the registration and expiry dates, the name servers, and the status locks on any domain, IP address or AS number. Read the record field by field, cross-check it with DNS and RDAP, and use the creation date and the name servers as your first phishing triage. The data is public, the query is passive, and the habit of saving every record pays off in every report you write.
Knowledge Check
whois command query, and on which port does the classic protocol run?clientTransferProhibited and redemptionPeriod mean?REDACTED FOR PRIVACY?Answers: 1. Public domain registration databases; TCP port 43. 2. A thick registry stores the full registrant record itself; a thin registry stores only the registrar and name servers, and the registrant details live with the registrar. 3. -h HOST; when the default referral picks the wrong server, when you want to compare RIR answers, or when the registrar record is missing. 4. clientTransferProhibited means the domain cannot be transferred without owner approval; redemptionPeriod means the domain is in its grace period before deletion and can usually still be recovered by its owner. 5. Run whois with the IP address, for example whois 8.8.8.8 — it returns the allocation, the owning organization and the abuse contact. 6. RDAP is the JSON-over-HTTPS successor to whois; it is machine-readable and is the authoritative record, so scripts should parse RDAP instead of scraping whois text. 7. GDPR and registrar privacy protection redact personal data from public records. 8. The creation date (domain age), whether the registration matches the claimed brand, and whether the name servers make sense.
Keep Learning
Tools
Frequently Asked Questions
Continue Learning
How to Do DNS Enumeration: Beginner's Guide to DNS Recon in Kali Linux
Learn how to do DNS enumeration step by step with dig, nslookup, dnsrecon and gobuster — a worked example, tool comparison and cheat sheet.
OSINT · IntermediateGoogle Dorking: How to Use Google Dorks for OSINT & Security Research
Learn Google dorking: advanced search operators, a worked OSINT example on a domain you own, GHDB dorks, a cheat sheet, and how to protect your site.
OSINT · BeginnerOSINT Tools: Best Free Tools, Techniques & Worked Examples for Beginners
The best OSINT tools for beginners — Maltego, theHarvester, Amass, Shodan, Sherlock and more — with real Kali Linux commands, a worked domain investigation, Google dorking and a cheat sheet. Learn what OSINT is and how to use it.
OSINT · IntermediateWHOIS Lookup Guide: Domain Registration Intelligence
Learn how to use WHOIS lookups for domain registration intelligence, including querying registrar data, analyzing historical records, and privacy protection.
Related Security Tools
DNS Lookup
Query DNS records including A, AAAA, MX, TXT, NS, CNAME, and SOA records for any domain.
Information GatheringWhois
Whois is a query and response protocol used for querying databases that store registered users of Internet resources. It provides information about domain registration, ownership, registrar details, name servers, and expiration dates for any domain or IP address block.
Network IntelligenceIP Lookup
Look up IPv4 and IPv6 addresses to find ISP, country, city, region, ASN, and organization details.
Domain IntelligenceWhois Lookup
Free WHOIS lookup for domains and IP addresses. Retrieve the registrar, creation, update and expiry dates, name servers, EPP domain status codes, and public registration records — with a field-by-field guide to reading the record, an explanation of RDAP (the protocol replacing WHOIS), and the domain-age checks security analysts use to spot newly registered phishing sites before they strike.