-
-
Notifications
You must be signed in to change notification settings - Fork 0
Usage
Damir Mukimov edited this page Nov 22, 2025
·
9 revisions
- Account Management
- Domain Management
- DNS Record Management
- DNS Record Types
- Examples
- Using Specific Accounts
- Plugins
- Bulk Operations
- Getting Help
- Common Workflows
| Command | Description | Example |
|---|---|---|
account list |
List all configured accounts | namecheap-dns account list |
account add [name] |
Add new account (interactive) | namecheap-dns account add work |
account switch <name> |
Switch default account | namecheap-dns account switch work |
account show [name] |
Show account details | namecheap-dns account show |
account edit [name] |
Edit account (interactive) | namecheap-dns account edit work |
account remove <name> |
Remove account | namecheap-dns account remove work |
View account management examples
# List all accounts
namecheap-dns account list
# Output:
# default (current)
# work
# personal
# Add new account interactively
namecheap-dns account add work
# Prompts for: username, API user, API key, client IP, sandbox mode, description
# Switch default account
namecheap-dns account switch work
# Now 'work' is the default account
# Show current account details (API keys are masked)
namecheap-dns account show
# Output:
# Account: work
# Username: workuser
# API User: workapiuser
# API Key: abcd***xyz
# Client IP: 203.0.113.1
# Sandbox: false| Command | Description | Example |
|---|---|---|
domain list |
List all domains | namecheap-dns domain list |
domain info <domain> |
Get domain details | namecheap-dns domain info example.com |
domain check <domain> |
Check availability | namecheap-dns domain check example.com |
domain renew <domain> [years] |
Renew domain | namecheap-dns domain renew example.com 1 |
domain nameservers get <domain> |
Get nameservers | namecheap-dns domain nameservers get example.com |
domain nameservers set <domain> <ns1> [ns2]... |
Set nameservers | namecheap-dns domain nameservers set example.com ns1.example.com ns2.example.com |
domain nameservers default <domain> |
Reset to default | namecheap-dns domain nameservers default example.com |
$ namecheap-dns domain list
Domain Expires Auto-Renew Premium
────────────────────────────────────────────────────────────
example.com 2026-01-15 Yes No
test.com 2025-12-20 No Yes
demo.org 2026-03-10 Yes No| Command | Description | Example |
|---|---|---|
dns list <domain> |
List all DNS records | namecheap-dns dns list example.com |
dns add <domain> <host> <type> <value> [ttl] |
Add DNS record | namecheap-dns dns add example.com www A 192.0.2.1 |
dns update <domain> <host> <type> <value> [ttl] |
Update DNS record | namecheap-dns dns update example.com www A 192.0.2.2 |
dns delete <domain> <host> <type> |
Delete DNS record | namecheap-dns dns delete example.com www A |
dns clear <domain> |
Clear all records | namecheap-dns dns clear example.com |
dns bulk <domain> <file> |
Bulk operations | namecheap-dns dns bulk example.com ops.yaml |
dns import <domain> <file> |
Import zone file | namecheap-dns dns import example.com zone.txt |
dns export <domain> [file] |
Export zone file | namecheap-dns dns export example.com |
| Type | Description | Example Value |
|---|---|---|
| A | IPv4 address | 192.0.2.1 |
| AAAA | IPv6 address | 2001:db8::1 |
| CNAME | Canonical name | www.example.com |
| MX | Mail exchange |
mail.example.com (priority: 10) |
| TXT | Text record | "v=spf1 include:_spf.example.com ~all" |
| NS | Name server | ns1.example.com |
| SRV | Service record | _service._tcp.example.com |
💡 Tip: Use
@for root domain, not empty string. Example:namecheap-dns dns add example.com @ A 192.0.2.1
Add an A Record
namecheap-dns dns add example.com www A 192.0.2.1
# Output:
# ✅ Successfully added A record: www.example.com -> 192.0.2.1Add an MX Record
namecheap-dns dns add example.com @ MX mail.example.com 10
# Output:
# ✅ Successfully added MX record: @example.com -> mail.example.com (priority: 10)Note: MX records require a priority number (lower = higher priority)
Add a CNAME Record
namecheap-dns dns add example.com www CNAME example.com
# Output:
# ✅ Successfully added CNAME record: www.example.com -> example.comAdd a TXT Record (SPF)
namecheap-dns dns add example.com @ TXT "v=spf1 include:_spf.example.com ~all"
# Output:
# ✅ Successfully added TXT record: @example.com -> "v=spf1 include:_spf.example.com ~all"# List only A records
namecheap-dns dns list example.com | grep "A "
# List only MX records
namecheap-dns dns list example.com | grep "MX "
# List records for specific host
namecheap-dns dns list example.com | grep "www"namecheap-dns account switch work
namecheap-dns domain list # Uses 'work' accountnamecheap-dns --account work domain list
namecheap-dns --account personal dns list example.comnamecheap-dns plugin listnamecheap-dns plugin info <plugin-name># Migadu email hosting setup
namecheap-dns migadu setup example.com
# Verify Migadu setup
namecheap-dns migadu verify example.com
# Remove Migadu records
namecheap-dns migadu remove example.comCreate a file with operations:
operations:
- action: add
host: www
type: A
value: 192.0.2.1
ttl: 3600
- action: update
host: mail
type: A
value: 192.0.2.2
ttl: 3600
- action: delete
host: old
type: ARun:
namecheap-dns dns bulk example.com operations.yamlSome commands support --dry-run to preview changes:
namecheap-dns migadu setup example.com --dry-run# General help
namecheap-dns help
# Command-specific help
namecheap-dns account --help
namecheap-dns domain --help
namecheap-dns dns --help
namecheap-dns plugin --help# 1. Check domain
namecheap-dns domain check newdomain.com
# 2. List current DNS records
namecheap-dns dns list newdomain.com
# 3. Add required records
namecheap-dns dns add newdomain.com @ A 192.0.2.1
namecheap-dns dns add newdomain.com www CNAME newdomain.com
# 4. Verify setup
namecheap-dns dns list newdomain.com# 1. Setup Migadu DNS records
namecheap-dns migadu setup example.com --dry-run
# 2. Review changes, then apply
namecheap-dns migadu setup example.com
# 3. Verify setup
namecheap-dns migadu verify example.com# 1. Add accounts
namecheap-dns account add personal
namecheap-dns account add work
# 2. List domains from different accounts
namecheap-dns --account personal domain list
namecheap-dns --account work domain list
# 3. Switch default account
namecheap-dns account switch work