whois — 查詢網域或 IP 的登記資訊
查詢網域或 IP 的 WHOIS 登記資訊,含擁有者與到期日。
語法
whois [選項] 網域或IP
常用選項
| 選項 | 說明 | 範例 |
|---|---|---|
-h 主機 |
指定 WHOIS 伺服器 | whois -h whois.apnic.net 8.8.8.8 |
使用範例
範例 1:查詢網域資訊
$ whois google.com
Domain Name: GOOGLE.COM
Registrar: MarkMonitor Inc.
Creation Date: 1997-09-15T00:00:00Z
Expiry Date: 2028-09-14T00:00:00Z
Name Server: NS1.GOOGLE.COM
範例 2:查詢 IP 歸屬
查詢某個 IP 屬於哪個組織或 ISP。
$ whois 8.8.8.8
NetRange: 8.8.8.0 - 8.8.8.255
NetName: LVLT-GOGL-8-8-8
Org: Google LLC
範例 3:只顯示關鍵資訊
whois 輸出較長,用 grep 過濾關鍵欄位。
$ whois example.com | grep -i "expir\|registrar\|created"
Creation Date: 1995-08-14T04:00:00Z
Expiry Date: 2026-08-13T04:00:00Z
Registrar: RESERVED-Internet Assigned Numbers Authority
常見錯誤與排錯
whois: command not found
- 原因
- whois 未安裝。
- 解法
- sudo apt install whois(Debian/Ubuntu)。