Common tasks
Paired with DNS: dig tells you which IP a domain has; whois tells you who owns that IP/domain.
Shows a domain's or IP's owner and abuse contact; for domains, some fields are hidden by the registrar's privacy shield.
whois example.com
a domain (registrar, expiry, NS)
whois 1.2.3.4
an IP (network, provider, abuse)
whois IP | grep -i abuse
the abuse contact
whois IP | grep -iE 'cidr|netrange'
the network block (for banning)
whois -h whois.ripe.net IP
a specific registry
whois queries registration data for a domain or IP: owner, registrar,
dates, network range, abuse contacts. Useful when investigating
suspicious traffic, checking a domain, or finding who to complain to
about an attack.
Not installed?
sudo apt install whois.
A top-level whois server often just forwards to a regional registry
(RIPE, ARIN, APNIC) — -h queries the right server directly if the
general answer is truncated or incomplete. IP data is usually more
complete than domain data: domains have some fields hidden by the
registrar's privacy protection (GDPR).
| Option | What it does | Example |
|---|---|---|
-h server |
Query a specific whois server instead of the default one. | whois -h whois.ripe.net 1.2.3.4 |
Nothing found. Try a shorter query.
Paired with DNS: dig tells you which IP a domain has; whois tells you who owns that IP/domain.
A typical path for "where is this coming from" (combined with fail2ban/journalctl logs):
The data is hidden by privacy protection (GDPR/WHOIS privacy). Some fields are only visible to the registrar. For an IP, the data is usually more complete than for domains.
The top-level whois server points to the registrar/registry. Query the
right server directly with -h (RIPE/ARIN/APNIC, by the IP's region).
whois 1.2.3.4 → abuse/OrgAbuseEmail (a complaint), NetRange/CIDR
(the whole block, for blocking in firewall).
The registry rate-limits queries. Don't hammer it in a loop; cache the result.
Found an inaccuracy? Report an error in the article