whois
Python package for retrieving WHOIS information of domains.
What it is and what it does
Whois is a Python package that queries WHOIS servers to retrieve domain registration metadata—registrar, expiration date, nameservers, and other administrative details. It wraps the system-level whois command and parses its output into structured data. Version 1 (current stable) uses the classic WHOIS protocol; version 2 (recently released) adds RDAP as a primary source, falling back to WHOIS when RDAP returns no data. The package requires Python >=3.9 and depends on whodap and tld libraries; redis is optional for caching.
The package is designed for developers who need to automate domain lookups—checking expiration dates, verifying registrars, or bulk-querying domain metadata. It includes both a Python API and a command-line tool. Note that RDAP servers only recognize real IANA domains and do not support first-level domain concepts; the package does not handle IP CIDR ranges or AS information.
Use it for:
- Check domain expiration dates programmatically to trigger renewal reminders or alerts.
- Retrieve registrar and nameserver information for domain portfolio management or audits.
- Bulk query domain metadata for security research or compliance verification.
- Automate WHOIS lookups in monitoring or alerting systems that track domain status changes.
- Verify domain ownership details as part of a larger domain validation workflow.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Retrieves WHOIS information for domain names by querying WHOIS servers and parsing the results, supporting both legacy WHOIS and RDAP protocols.
Yes, with conditions. The package is actively maintained, has no known vulnerabilities, and low install friction. However, it requires a system whois command to be installed separately, and v2's RDAP support is very recent (2026 releases); if you need stable, battle-tested code, v1 is safer. For straightforward domain metadata retrieval, it's a solid choice; for production systems relying on RDAP, verify v2 stability first.
Install
whois on PyPI
pip
pip install whoisuv
uv add whoispoetry
poetry add whoisInstalling whois
Before you install
Low install friction with no runtime dependencies in the wheel distribution. Active maintenance with recent commits as of 2026-08-07, though the latest PyPI release is from 2024-02-03. Requires Python >=3.9 and the system-level whois command-line tool to be installed separately.
License in practice
Licensed under MIT (permissive), allowing free use, modification, and distribution with minimal restrictions.
Quickstart
pip install whois
import whois
result = whois.query('example.com')
print(result.expiration_date)
Requires the system whois command-line tool to be installed on your OS (e.g., via apt, brew, or your distribution's package manager); on macOS, brew install whois is recommended for reliable parsing.
Verify before relying
- Whether v2's RDAP-first approach is production-ready or still experimental given the recent 2026 release dates.
- Current compatibility status between v1 output and the original DanyCork whois package after v2 refactoring.
- Performance and reliability differences between RDAP and classic WHOIS fallback in real-world use.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 923 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 101,796/month — #12,916 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: whois-1.20240129.2-py3-none-any.whl
Keywords: Python, domain, expiration, registrar, tld, whois
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
PyFunceble-devPyFunceble checks whether domains, IPs, and…
permissive · top 15,000 on PyPI
python-whoisQueries WHOIS servers directly to retrieve and…
permissive · top 5,000 on PyPI
ipwhoisRetrieves and parses whois and RDAP data for…
permissive · top 15,000 on PyPI
whoisitQuery RDAP (Registration Data Access Protocol)…
unclear · top 15,000 on PyPI
tldsProvides a set of valid top-level domains…
permissive · top 15,000 on PyPI
publicsuffix2Extracts the public suffix and registrable…
copyleft · top 5,000 on PyPI
tldparseParses domain names into their constituent…
permissive · top 15,000 on PyPI
tldextractAccurately extracts subdomain, domain, and…
permissive · top 1,000 on PyPI
tldExtracts the top-level domain (TLD) and…
copyleft · top 5,000 on PyPI
dnstwistGenerates domain name permutations to detect…
permissive · top 15,000 on PyPI