Overview
What is WHOIS?
Whois is a popular Internet record listing that shows who owns a domain and how to contact them. Domain name registration and ownership are governed by the Internet Corporation for Assigned Names and Numbers (ICANN). Each Whois record will typically contain information such as the Registrant's (who owns the domain) name and contact information, the Registrar's (the organisation or commercial entity that registered the domain name), the registration dates, the name servers, the most recent update, and the expiration date.
Python program for extracting WHOIS information
Prepare your tools
We'll be using the whois
module in Python. You can install this module using the pip
command like this:
pip install python-whois
Python Code
from whois import whois
def extract(domainOrIp):
w = whois(domainOrIp)
return w
domainOrIp = input("Enter Domain Name or IP Address: ")
data = extract(domainOrIp)
print(data)
Tool Preview
Use our tool
Previous Blog← Download Youtube Videos With Python
Next BlogDNS Lookup using Python →