python3 亲试可行
1、pip install python-whois
2、
def is_registered(domain_name):
"""
A function that returns a boolean indicating
whether a `domain_name` is registered
"""
try:
w = whois.whois(domain_name)
except Exception:
return False
else:
return bool(w.domain_name)
原文:https://www.cnblogs.com/pyclq/p/14793828.html