Skip to content
Damir Mukimov edited this page Nov 22, 2025 · 9 revisions

Usage Guide

📚 Table of Contents


👤 Account Management

Command Reference

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

Examples

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

🌐 Domain Management

Command Reference

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

Domain List Output

$ 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

📝 DNS Record Management

Command Reference

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

📋 DNS Record Types

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

💡 Examples

Basic DNS Operations

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.1
Add 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.com
Add 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"

Filtering Records

# 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"

Using Specific Accounts

Switch Account Permanently

namecheap-dns account switch work
namecheap-dns domain list  # Uses 'work' account

Use Account for Single Command

namecheap-dns --account work domain list
namecheap-dns --account personal dns list example.com

Plugins

List Available Plugins

namecheap-dns plugin list

Plugin Information

namecheap-dns plugin info <plugin-name>

Using Plugins

# 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.com

Bulk Operations

Bulk DNS Updates

Create 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: A

Run:

namecheap-dns dns bulk example.com operations.yaml

Dry Run Mode

Some commands support --dry-run to preview changes:

namecheap-dns migadu setup example.com --dry-run

Getting Help

# General help
namecheap-dns help

# Command-specific help
namecheap-dns account --help
namecheap-dns domain --help
namecheap-dns dns --help
namecheap-dns plugin --help

Common Workflows

Setting Up a New Domain

# 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

Migrating Email Hosting (Migadu)

# 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

Managing Multiple Accounts

# 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

Clone this wiki locally