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.
# 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
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
| Command | What it does | Endpoint |
|---|---|---|
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> |
monitor | Recent domain changes | /monitor/changes |
download | Daily newly registered domain file: tld, type, date | /nrds/download |
usage | Credits used and left, per endpoint | /usage |
health | Service status, no key needed | /health |
get <path>post <path> <json|-> | Any endpoint, for parameters or routes without a shortcut | any |
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
jqor any JSON tool. - Files:
export=csv,export=txtanddownloadsave a file and print{"saved": "...", "bytes": ...}. The server picks the file name;-o FILEsets 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 code | Meaning |
|---|---|
0 | Success |
1 | API error. The error body prints to stdout; the HTTP status, Retry-After and the time until the rate limit window resets go to stderr. |
2 | Usage or network error, such as a missing argument, a missing key or no connection |
Recipes
dk search nrds query=ai tld=com limit=100 | jq -r '.data[].domain'
dk search expired tld=com age_min=5 sort=age_desc export=csv -o expired-com.csv
dk bulk whois - < domains.txt
Get-Content domains.txt | dk bulk whois - # PowerShell
DOMAINKITS_API_KEY=dk_xxx 15 6 * * * /usr/local/bin/dk download tld=com type=domains_only -o ~/nrd/com-$(date +\%F).txt.gz
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
dk get search/nrds tld=com
echo '{"domains":["example.com","example.org"]}' | dk post bulk/dns -
Environment Variables
| Variable | Purpose |
|---|---|
DOMAINKITS_API_KEY | Your API key. Needed for every command except health. |
DOMAINKITS_API_URL | Override 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.