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
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
auth loginConfigure credentialsauth statusCheck auth statusauth whoamiUser info & balancedomains listList all domainsdomains infoGet domain detailsdomains checkCheck availabilitydns listList DNS recordsdns addAdd a recorddns setReplace a recorddns rmRemove a recorddns exportExport as JSON/zonedns syncSync from filepreset listList presetspreset applyApply a presetpreset removeRemove presetns list/set/resetManage nameserversredirect add/rmURL redirectsverifyCheck propagationUse --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:
namecheap-cli is open source and MIT licensed. Contributions welcome on GitHub.