Linux每日一篇 - 85 - whois
Linux域名信息查询神器!掌握whois命令,轻松查询域名注册信息,了解域名归属!
whois命令是什么?
whois命令用于查询域名的注册信息,包括域名所有者、注册商、注册日期、到期日期、域名服务器等信息,是网络管理和安全分析的重要工具。
基本用法
# 查询域名信息
whois example.com
# 指定WHOIS服务器查询
whois -h whois.verisign-grs.com example.com
# 查询IP地址的注册信息
whois 8.8.8.8
# 查询特定TLD的域名
whois example.org
# 获取原始数据
whois -r example.com
# 查询域名状态
whois -s example.com
实用技巧
# 查询常用域名信息
whois google.com
# 查询域名是否可用
whois example-domain-12345.com
# 查询IP地址的归属
whois 1.1.1.1
# 获取特定域名的到期时间
whois example.com | grep -i "expire\|expiry\|eolas"
# 查看域名的名称服务器
whois example.com | grep -i "nameserver\|ns "
# 查询域名的注册商
whois example.com | grep -i "registrar"
# 检查域名是否被注册
whois example.com | head -10
# 查询电子邮件域名
whois -h whois.arin.net 192.168.1.1
常用场景
# 检查域名是否已注册
whois example.com
# 查找域名的联系信息
whois example.com | grep -i "admin\|tech\|registrant"
# 检查域名的DNS服务器
whois example.com | grep -i "domain servers\|name server"
# 查看域名注册和到期日期
whois example.com | grep -i "created\|updated\|expires"
# 查询IP地址段的归属
whois 192.168.0.0/24
# 检查域名是否可以注册
whois never-been-registered-domain-12345.com
# 在脚本中使用whois信息
if whois example.com 2>&1 | grep -q "No match\|not found\|NOT FOUND"; then
echo "域名未注册,可以注册"
else
echo "域名已被注册"
fi
# 获取域名的详细技术信息
whois example.com | grep -E "(Name Server|DNS|Registrar|Status)"