Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

whois-format

Whois client wrapper producing a terse, single-line format.

Why?

When dealing with security threats, an important aspect to analyze and track is the attacker's infrastructure (ref. Diamond Model). WHOIS provides a distributed database containing registered domain information, and an associated protocol for querying this information.

One issue with WHOIS data is that as a directory record format, it can contain a lot of information - sometimes many dozens of lines of output, with some being repeated, and in the modern day, much of this being boilerplate redacted information due to WHOIS privacy. Additionally, not every registry's record format is the same, so the lack of consistency can be difficult to deal with. As an analyst, when looking up domain name information, this can be tedious. In some cases, you may spend a good amount of time copying, pasting and formatting data from WHOIS records.

Features

This tool attempts to ease this by presenting WHOIS information in a brief format:

  • Domain information in a terse, consistent single-line layout.
  • Suitable for grep(1) and for arranging on a page in a readable columnar format.
  • Information output is only key fields useful for typical purposes: domain name, registration date, registrar, nameservers, registrant name (or organization), and registrant email.

The output format is optimized for plain text use, and fields are separated using two spaces, with multiple value fields separated with a comma and space. This format is intended for reading, not parsing.

A default sleep time of 15 seconds is implemented as a blunt pause so that lookups don't trigger thresholds on WHOIS servers, which can result in blocklisting or further data redaction. When looking up multiple domains, this version of the tool pauses to collect information on all domains before outputting any data (this needs to be improved). This threshold can be adjusted using the -s option.

whois-format uses the python-whois library to query WHOIS.

Setup

It's recommended to use pipx for easy setup and isolation:

pipx install whois-format

Examples

Looking up a single input domain. The same syntax supports passing additional domains on the command line:

$ whois-format -d iana.org
IANA.ORG  1995-06-05  CSC Corporate Domains, Inc.  iana-servers.net, icann.org  REDACTED FOR PRIVACY  domainabuse@cscglobal.com

Querying for a list of domains from a newline-separated file:

$ whois-format -f tests/sample_domains.txt 
IANA.ORG       1995-06-05  CSC Corporate Domains, Inc.  icann.org, iana-servers.net   REDACTED FOR PRIVACY     domainabuse@cscglobal.com
ICANN.ORG      1998-09-14  GoDaddy.com, LLC             icann.org, icann-servers.net  REDACTED FOR PRIVACY     abuse@godaddy.com
SLACKWARE.COM  1995-12-26  Network Solutions, LLC       cwo.com                       Slackware Linux Project  abuse@web.com, volkerdi@gmail.com, domain.operations@web.com

Metadata

Release files for whois-format 0.1.1b1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for whois-format 0.1.1b1
File Size Uploaded
whois_format-0.1.1b1.tar.gz 5.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for whois-format 0.1.1b1
File Interpreter ABI Platform
whois_format-0.1.1b1-py3-none-any.whl Python 3 none any Details

Total release size: 11.5 kB

Release files / whois_format-0.1.1b1.tar.gz

Download URL whois_format-0.1.1b1.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
44f6f41a2b98e6b1315a5e126a8b9dc65b2ca3f7fa45a44a843a57e906afb05d
BLAKE2b-256 checksum
How to use checksums
ed9ddbd150e29237bff7dae91eda873b8d4fa691aa4706a1f182d6a35ffd0e5c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.2

Release files / whois_format-0.1.1b1-py3-none-any.whl

Download URL whois_format-0.1.1b1-py3-none-any.whl
Size 5.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c82a15bda678a586851b062eeb4bac8460b76cb091783de3025f0629cd9e38df
BLAKE2b-256 checksum
How to use checksums
a81ab1b6aeaba3e75f27069a7e3f51d4a4219b3b648449fc342a60ec3d4d4fc7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.2
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page