skillfed

whois

Python package for retrieving WHOIS information of domains.

whois v1.20240129.2 101.8K downloads/30d#12,916 on PyPI61
Permissive license Active released

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 whois

uv

uv add whois

poetry

poetry add whois

Installing 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

Environment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Topic :: InternetTopic :: Software Development :: Libraries :: Python Modules

Tags

whois domain lookupdomain registration infowhois parser pythondomain expiration checkrdap domain queryregistrar informationtld whois retrieval
domain-lookuprdapcli-tool

More Python Modules packages