
Want to check who registered a domain? When does it expire? With the Linux <span>whois</span> command, you can do it in one line!
Note: Not all Linux systems have whois installed by default!
Don’t worry, we will go through the entire process from “checking → installing → using → interpreting” 👇
✅ Step 1: First, check if whois is available
Open the terminal and type:
whois baidu.com
👉 If you get a normal output → Lucky you, jump to 【Step 3】 and use it directly!
👉 If you see <span>command not found</span> → Don’t panic, proceed to Step 2 to install!
✅ Step 2: Install whois (choose a command based on your system)
Different Linux distributions have different installation commands:
🔹 Ubuntu / Debian / Linux Mint:
sudo apt update && sudo apt install whois -y
🔹 CentOS 7 / RHEL 7:
sudo yum install whois -y
🔹 CentOS 8+ / RHEL 8+ / Rocky Linux / AlmaLinux:
sudo dnf install whois -y
🔹 Arch Linux / Manjaro:
sudo pacman -S whois
🔹 openSUSE:
sudo zypper install whois
🔹 Mac users (not Linux but compatible):
brew install whois
You need to install Homebrew first (https://brew.sh)
✅ Step 3: Use whois to query
After successful installation, directly query any domain:
whois qq.com
whois github.com
whois yourdomain.com
Press Enter, wait a few seconds, and the complete registration information will be displayed!
🔍 Step 4: Understand the key information (highlighted)
Is the query result long? Don’t worry, just focus on these few lines:
Domain Name: EXAMPLE.COM
Registrar: Alibaba Cloud Computing Ltd.
Creation Date: 2020-05-20
Expiration Date: 2025-05-20
Name Server: NS1.EXAMPLEDNS.COM
Registrant Email: REDACTED FOR PRIVACY
✔️ Domain name, registrar, registration/expiration date → definitely available✔️ Email/phone/name → may be hidden for privacy protection (normal)✔️ Name Server → DNS server used for domain resolution
💡 Tips:
🔸 Query specific fields (filter output):
whois baidu.com | grep -i "expir"
→ Quickly locate the “expiration date”
🔸 Save output to a file:
whois taobao.com > taobao_whois.txt
→ Convenient for later analysis or archiving
⚠️ Common Issues & Pitfall Guide:
❓Q1: What if I see “Unable to locate package whois” during installation?
→ Please run <span>sudo apt update</span> (for Debian-based) or check your network/source configuration.
❓Q2: Why can’t I find any information or it returns blank?
→ It may be due to high query frequency being rate-limited, or the domain is too new and not synchronized. Try another site (like whois.icann.org) for cross-validation.
❓Q3: Why is some information “REDACTED FOR PRIVACY”?
→ This is due to GDPR or registrar privacy protection services, which is legal and compliant, and cannot be bypassed.
🎯 Applicable Scenarios:
✔️ System administrators checking client domain status✔️ Website builders confirming if a domain is about to expire✔️ Investors screening for available domains✔️ Security personnel tracing phishing websites✔️ Students learning practical Linux commands
✅ In summary:
To check domain information on Linux, rely on the <span>whois</span> command —👉 Not installed? Install one according to your system!👉 Already installed? Just query, it’s super convenient!