Production-grade CLI tool to perform Reverse WHOIS queries and enumerate domains whose WHOIS records contain specific search terms. Built for cybersecurity analysts, threat intel workflows, OSINT enrichment, and vendor/brand footprint discovery using a commercial data provider API.
Repository: https://github.com/haltman-io/reverse-whois
In security investigations and due diligence, you often start with a single reference point (e.g., a known domain, brand, organization name, email, or unique string) and need to identify other related domains that share that term somewhere in WHOIS data. Reverse WHOIS enables that pivot efficiently using indexed WHOIS datasets (current and optionally historic records).
This tool focuses on:
- Repeatable CLI usage
- Greppable / pipeline-friendly output
- Safe defaults
- Proxy + concurrency + rate limiting controls for operational environments
-
Reverse WHOIS search by term (single or multiple targets)
-
Supports current and historic WHOIS search modes
-
Supports preview (count only) and purchase (domains list) modes
- Default request mode is
purchase(even though the API defaults topreview)
- Default request mode is
-
Multiple target input methods:
stdin/ pipeline--target/-t(repeatable and comma-separated)--target-list/-tL(repeatable and comma-separated file paths)
-
Exclusion filter support:
--exclude/-e(repeatable and comma-separated)- max 4 exclude items (API constraint)
-
API key management
--api-key <KEY>takes priority- fallback YAML config near the executable:
.reverse-whois.yaml - supports multiple keys and round-robin rotation per request
-
Proxy support:
- HTTP/HTTPS and SOCKS5 via
--proxy --no-proxyto ignore env vars- respects
HTTP_PROXY,HTTPS_PROXY,NO_PROXYunless--no-proxy
- HTTP/HTTPS and SOCKS5 via
-
TLS bypass for lab environments:
--insecure/-kdisables TLS verification (curl-style)
-
Concurrency:
--threads <n>worker pool execution
-
Rate limiting:
--rate-limit/-rl <rps>global max requests/second across all threads- API hard limit: 30 rps (tool rejects values > 30)
-
Output options:
- colored terminal output (ANSI), disable with
--no-color --output/-o/-out <file>writes clean results (no ANSI, deduplicated)
- colored terminal output (ANSI), disable with
-
Logging controls:
--silent/--quietsuppress banner/logs (results still printed)--verbose/--debugenable debug logging (stderr)
Native endpoint:
https://reverse-whois.whoisxmlapi.com/api/v2
Required header:
Content-Type: application/json
Request fields used by this tool:
apiKey(required)basicSearchTerms.include(required, max 4 items; tool uses a single term per request)basicSearchTerms.exclude(optional, max 4 items)searchType(currentorhistoric; defaultcurrent)mode(previeworpurchase; tool defaultpurchase)punycode(set totrue)
Terminal output is structured and greppable:
[$SEARCH_TERM] [$MODE] [$SEARCH_TYPE] [$Key: $Value]
Command:
reverse-whois -t thc.org --preview --historyOutput:
[thc.org] [preview] [historic] [domainsCount: 42]
Command:
reverse-whois -t thc.org --historyOutput:
[thc.org] [purchase] [historic] [domain: an-thc.org]
[thc.org] [purchase] [historic] [domain: instituto-thc.org]
...
When --output is set, the tool still prints normal output to stdout, but the output file is written in a clean, tool-friendly format:
- No ANSI colors
- Deduplicated
- Purchase mode: one domain per line
- Preview mode:
term<TAB>countper request (to keep multi-target output unambiguous)
Example:
reverse-whois -t thc.org --history --output out.txtout.txt:
an-thc.org
instituto-thc.org
xn--stockholmsutstllningen2030-thc.org
...
Overwrite behavior: if the file exists, it is overwritten.
Note: The tool does not create parent directories. If the path is invalid, it exits with an error.
- Go 1.22+
git clone https://github.com/haltman-io/reverse-whois.git
cd reverse-whois
go mod tidy
go build -o reverse-whois ./cmd/reverse-whois
./reverse-whois -hgo install github.com/haltman-io/reverse-whois/cmd/reverse-whois@latest
reverse-whois -hIf the binary is not found, ensure:
$GOBINor$(go env GOPATH)/binis in yourPATH.
On startup, the tool checks for a YAML file next to the executable:
.reverse-whois.yaml
If it does not exist, it is created automatically with:
api_keys: []-
If
--api-key <KEY>is provided → used for all requests. -
Else, the tool reads
.reverse-whois.yaml:- if
api_keysis empty → exits with an error - if it contains multiple keys → keys are rotated round-robin per request
- if
Targets
--target, -t <target>Define a search term target (repeatable; supports comma-separated values).--target-list, -tL <file>Define a file containing targets (repeatable; supports comma-separated paths).stdin/ pipeline Provide targets via pipe:cat targets.txt | reverse-whois
API
--api-key <API_KEY>Provide an API key directly (takes priority over YAML).
Search type
--history(alias:--historic) SetssearchType=historic. Default iscurrent.
Mode
--preview(alias:--check) Setsmode=preview(count only). Default ispurchase.
Exclude terms
--exclude <term>(alias:-e) Adds term(s) tobasicSearchTerms.exclude. Repeatable and comma-separated. Maximum 4 items.
Proxy / TLS
--proxy <url>Supports:http://,https://,socks5://--no-proxyIgnore proxy environment variables.--insecure, -kSkip TLS certificate verification.
Concurrency / rate limit
--threads <n>Worker count (default: 1).--rate-limit <rps>, -rl <rps>Global max requests/second across all threads. Must be>= 1and<= 30.
Output / logging
--output <path>, -o <path>, -out <path>Write clean results to a file (overwrite).--silent, -s/--quiet, -qResults only (no banner/logs).--verbose, -v/--debugEnable debug logs (stderr).--no-color, -ncDisable ANSI color output.
reverse-whois -t thc.orgreverse-whois -t thc.org -t example.comreverse-whois -t thc.org,example.comreverse-whois -tL targets1.txt -tL targets2.txt
reverse-whois -tL targets1.txt,targets2.txtcat targets.txt | reverse-whois
cat targets.txt | reverse-whois --historyreverse-whois -t thc.org -e freejulian.org
reverse-whois -t thc.org -e freejulian.org,example.net
reverse-whois -t thc.org -e a -e b -e c -e dIf you exceed 4 exclude items, the tool exits with an error.
reverse-whois -t thc.org --proxy http://127.0.0.1:8080reverse-whois -t thc.org --proxy https://127.0.0.1:8443reverse-whois -t thc.org --proxy socks5://127.0.0.1:9050reverse-whois -t thc.org --no-proxyreverse-whois -t thc.org --proxy http://127.0.0.1:8080 -kWarning:
--insecure/-kdisables TLS verification. Use only when you understand the security implications.
reverse-whois -t thc.org --threads 5reverse-whois -t thc.org -rl 10
--rate-limitis global across all workers. It is not per-thread.
reverse-whois -t thc.org --threads 10 -rl 30If you set -rl above 30, the tool exits with an error.
The tool provides direct, user-facing HTTP error messages based on API responses:
400 Bad Request: missing/invalid request fields401 Unauthorized: missing/invalid API key403 Forbidden: access restricted / credits / invalid key408 Request Timeout: provider timeout410 Gone: API version deprecated422 Unprocessable Entity: invalid parameters or search term429 Too Many Requests: rate-limited5XX: provider internal error (contact support)
- Use this tool only for authorized investigations and legitimate security workflows.
- This tool outputs domains returned by a commercial provider. Avoid unnecessary data collection and follow your org’s policies.
- API keys are sensitive credentials. Prefer environment isolation and do not commit keys to Git.
git clone https://github.com/haltman-io/reverse-whois.git
cd reverse-whois
go mod tidycmd/reverse-whois/— CLI entrypoint (wiring only)internal/cli/— flags, config, usageinternal/targets/— target collection, parsing, dedupeinternal/api/— HTTP client, request/response modelsinternal/ratelimit/— global limiter utilitiesinternal/output/— banner, colors, formatters/printerinternal/util/— shared helpers (logging, YAML, writers)
- Keep comments, identifiers, and logs in English
- Prefer small, testable functions
- Avoid breaking output format without documenting changes
- If adding new providers/endpoints, keep
internal/api/modular and avoid leaking provider logic into unrelated packages
- Provide a clear summary and motivation
- Include before/after output examples if formatting changes
- Update README when behavior changes
If you discover a security issue in this repository:
-
Do not open a public GitHub issue.
-
Send a report with:
- a clear description of the issue
- impact assessment
- reproduction steps / PoC (if applicable)
- suggested remediation
-
Contact:
- Create a private advisory (recommended) via GitHub Security Advisories (if enabled), or
- Email the maintainers:
security@haltman.io
This project is licensed under the Unlicense, see the LICENSE file for details.



