Open Source · MIT

DomainKits CLI: Domain Data in Your Terminal

dk is the open-source command-line client for the DomainKits API: search newly registered, expired and for-sale domains, run WHOIS and DNS lookups, pull registration trends and download NRD files from your terminal.

dk search nrds query=ai tld=com limit=20
dk whois example.com
dk download tld=com type=domains_only

Install dk

dk is a single binary with no dependencies. Each release on GitHub has builds for macOS, Linux and Windows on amd64 and arm64 (Apple silicon is darwin_arm64), plus a SHA256SUMS file to check the download.

macOS / Linux
# pick your build: darwin_arm64, darwin_amd64,
# linux_amd64 or linux_arm64
tar -xzf dk_*_darwin_arm64.tar.gz
sudo mv dk /usr/local/bin/
dk version
Windows
Expand-Archive dk_*_windows_amd64.zip C:\dk
# add C:\dk to your PATH, then
dk version

With Go 1.21 or newer, you can also build and install it in one step:

go install github.com/ABTdomain/domainkits-cli/cmd/dk@latest

Set Your API Key

dk reads your key from the DOMAINKITS_API_KEY environment variable. Keys start with dk_ and are created on your dashboard. The same key works for the REST API, the SDKs and the MCP server.

# macOS / Linux
export DOMAINKITS_API_KEY=dk_xxx

# Windows PowerShell
$env:DOMAINKITS_API_KEY = "dk_xxx"

# check the key and your credits
dk usage

dk health checks the service status and is the only API call that works without a key.

How Commands Work

Every command maps to one API endpoint. The first arguments fill the endpoint's required value (a search type, a domain, a nameserver), and everything after them goes to the API unchanged, so the filters in the API reference work as documented.

dk <command> [arguments] [key=value ...] [-o FILE]

dk search expired query=clinic tld=com
dk search expired --query clinic --tld=com      # same request

Parameters can be written as key=value, --key=value or --key value. A value that starts with - needs the key=value form. Unknown names and invalid values come back from the API with its error message, printed as returned.

Commands

CommandWhat it doesEndpoint
search <type>Search a domain database. Types: nrds, aged, active, expired, deleted, market, hostname, status/search/<type>
whois <domain>RDAP WHOIS record: registrar, dates, status codes, nameservers/whois
dns <domain>DNS records/dns
bulk whois <domains>WHOIS for a list of domains; - reads one domain per line from stdin/bulk/whois
bulk dns <domains>DNS for a list of domains; - reads from stdin/bulk/dns
ns-reverse <ns[,ns2]>Domains using all of the given nameservers/ns-reverse
ip-lookup <ip or domain>IP location and network/ip-lookup
registrar <name or IANA ID>Registrar details/registrar
status-guide <code>What an EPP status code means/status-guide
tld-check <prefix>One name across extensions/tld-check
typosquat <domain>Typo variants of a domain and which ones are registered/typosquat
ct subdomains <domain>Subdomains seen in certificate transparency logs/ct/subdomains
ct certs <domain>Certificates issued for a domain/ct/certs
trends tlds <newly|active>Registration volume per gTLD/trends/tlds/<type>
trends keywords <hot|emerging|prefix>Keyword rankings in new registrations/trends/keywords/<type>
monitorRecent domain changes/monitor/changes
downloadDaily newly registered domain file: tld, type, date/nrds/download
usageCredits used and left, per endpoint/usage
healthService status, no key needed/health
get <path>
post <path> <json|->
Any endpoint, for parameters or routes without a shortcutany

Run dk help for the same list in your terminal.

Output, Files and Exit Codes

  • JSON by default: the response body prints to stdout unchanged, ready for jq or any JSON tool.
  • Files: export=csv, export=txt and download save a file and print {"saved": "...", "bytes": ...}. The server picks the file name; -o FILE sets your own. A transfer that breaks off leaves nothing under the target name.
  • Exports: a search export returns up to 50,000 rows in one request and uses 1 Export credit on top of the endpoint's credits.
Exit codeMeaning
0Success
1API error. The error body prints to stdout; the HTTP status, Retry-After and the time until the rate limit window resets go to stderr.
2Usage or network error, such as a missing argument, a missing key or no connection

Recipes

Domain names only, with jq
dk search nrds query=ai tld=com limit=100 | jq -r '.data[].domain'
Export a search to CSV
dk search expired tld=com age_min=5 sort=age_desc export=csv -o expired-com.csv
WHOIS for a list of domains
dk bulk whois - < domains.txt
Get-Content domains.txt | dk bulk whois -      # PowerShell
Fetch the daily NRD file with cron
DOMAINKITS_API_KEY=dk_xxx
15 6 * * * /usr/local/bin/dk download tld=com type=domains_only -o ~/nrd/com-$(date +\%F).txt.gz
Branch on the exit code in a script
dk whois example.com > whois.json
case $? in
  0) echo "ok" ;;
  1) echo "API error, see whois.json" ;;
  2) echo "usage or network error" ;;
esac
Any endpoint
dk get search/nrds tld=com
echo '{"domains":["example.com","example.org"]}' | dk post bulk/dns -

Environment Variables

VariablePurpose
DOMAINKITS_API_KEYYour API key. Needed for every command except health.
DOMAINKITS_API_URLOverride the API base URL, for example to point dk at a proxy. Most setups leave it unset.

Frequently Asked Questions

Which plans can use the DomainKits CLI?

dk runs on your API key. dk download works on every plan, with the files and days of history of your plan, the same as on the NRD download page. The other commands call endpoints included with Premium and higher plans. See pricing to compare plans.

Where do I get an API key for dk?

Create your key on your dashboard. Keys start with dk_. The same key works for the REST API, the SDKs, the MCP server and the CLI, so there is nothing extra to set up for dk.

How does dk use API credits?

Each command sends one API request and uses the same credits as that request would through curl or an SDK. An export (export=csv or export=txt) adds 1 Export credit. Run dk usage to read your per-endpoint counters.

Is dk open source?

Yes. dk is published under the MIT license on GitHub. Each release ships builds for macOS, Linux and Windows on amd64 and arm64, with SHA-256 checksums.