← All Tools

Your DNS, your way. Manage, automate, and version your domains from the command line.

Why namecheap-cli?

Web UIs are slow. Click, wait, repeat. Multiply that across domains and you're burning time on busywork.

namecheap-cli lets you define DNS as code, apply presets with one command, and sync configurations across domains. Script it, version it, automate it.

Full DNS Control

List, add, modify, and remove DNS records. Support for A, AAAA, MX, TXT, CNAME, and more. Filter by type, export as JSON or zone files.

Bulk Sync

Define your DNS state in a file and sync it to your domain. See a diff before applying, optionally delete records not in your config.

Service Presets

One command to configure GitHub Pages, Google Workspace, ProtonMail, Cloudflare, Netlify, and more. No more hunting for MX record values.

Cross-Platform

Works on Linux, macOS, and Windows. Written in Rust for fast, reliable execution without runtime dependencies.

Install

Download a pre-built binary for your platform, or install from crates.io:

cargo install namecheap-cli

Or build from source:

git clone https://github.com/uRadical/namecheap-cli
cd namecheap-cli
cargo install --path .

Quick Start

1. Enable API access in your Namecheap account settings and whitelist your IP.

2. Configure your credentials:

namecheap auth login

3. List your domains:

namecheap domains list

4. View DNS records:

namecheap dns list example.com

5. Add a record:

namecheap dns add example.com A www 192.0.2.1

Service Presets

Skip the documentation trawl. Apply battle-tested configurations for popular services with a single command:

namecheap preset apply github-pages example.com
namecheap preset apply google-workspace example.com
namecheap preset apply protonmail example.com
GitHub Pages Google Workspace ProtonMail Cloudflare Netlify Fastmail Zoho Mail

Sync from File

Define your DNS configuration as code and sync it to your domain. Preview changes with --dry-run:

namecheap dns sync example.com records.json --dry-run

Use --delete to remove records not defined in your file, ensuring your live DNS exactly matches your configuration.

Verify Propagation

Check if your DNS changes have propagated:

namecheap verify example.com

Add --wait to poll until propagation completes—useful in CI/CD pipelines.

Commands

namecheap-cli
auth loginConfigure credentials
auth statusCheck auth status
auth whoamiUser info & balance
domains listList all domains
domains infoGet domain details
domains checkCheck availability
dns listList DNS records
dns addAdd a record
dns setReplace a record
dns rmRemove a record
dns exportExport as JSON/zone
dns syncSync from file
preset listList presets
preset applyApply a preset
preset removeRemove preset
ns list/set/resetManage nameservers
redirect add/rmURL redirects
verifyCheck propagation

Use --json for machine-readable output, --dry-run to preview changes, and -y to skip confirmation prompts.

Configuration

Credentials can be configured via interactive setup, environment variables, or a config file:

configuration
# Interactive setup
namecheap auth login
 
# Environment variables
export NAMECHEAP_API_USER="..."
export NAMECHEAP_API_KEY="..."
export NAMECHEAP_USERNAME="..."
export NAMECHEAP_CLIENT_IP="..."
 
# Config file with profile support
$ cat ~/.config/namecheap-cli/config.toml
default_profile = "default"
 
[profiles.default]
api_user = "your_api_username"
api_key = "your_api_key"
username = "optional_username"
client_ip = "1.2.3.4"
sandbox = false
 
[profiles.work]
api_user = "work_account"
api_key = "work_key"
sandbox = true
namecheap-cli is open source and MIT licensed. Contributions welcome on GitHub.