Documentation / dns

namecheap dns

DNS record management commands

Every command below also accepts the global options.

namecheap dns

DNS record management commands

namecheap dns [OPTIONS] <COMMAND>

namecheap dns list

List DNS records for a domain

namecheap dns list [OPTIONS] <DOMAIN>

Arguments

<DOMAIN>Domain name

Options

-t, --record-type <RECORD_TYPE>Filter by record type

namecheap dns add

Add a DNS record

namecheap dns add [OPTIONS] <DOMAIN> <RECORD_TYPE> <HOST> <VALUE>

Arguments

<DOMAIN>Domain name
<RECORD_TYPE>Record type (A, AAAA, CNAME, MX, TXT, NS, SRV, CAA, ALIAS, URL, URL301, FRAME)
<HOST>Host/subdomain (use @ for root)
<VALUE>Record value. For A, AAAA, MX and NS this may be a comma-separated list, adding one record per value

Options

--ttl <TTL>TTL in seconds [default: 1800]
--priority <PRIORITY>Priority (required for MX records)

namecheap dns set

Set/replace a DNS record

namecheap dns set [OPTIONS] <DOMAIN> <RECORD_TYPE> <HOST> <VALUE>

Arguments

<DOMAIN>Domain name
<RECORD_TYPE>Record type
<HOST>Host/subdomain (use @ for root)
<VALUE>Record value. For A, AAAA, MX and NS this may be a comma-separated list, replacing the whole set for this type and host

Options

--ttl <TTL>TTL in seconds [default: 1800]
--priority <PRIORITY>Priority (required for MX records)

namecheap dns rm

Remove a DNS record

namecheap dns rm [OPTIONS] <DOMAIN> <RECORD_TYPE> <HOST> [VALUE]

Arguments

<DOMAIN>Domain name
<RECORD_TYPE>Record type
<HOST>Host/subdomain (use @ for root)
[VALUE]Record value (optional, removes all matching type+host if not specified)

namecheap dns export

Export DNS records

namecheap dns export [OPTIONS] <DOMAIN>

Arguments

<DOMAIN>Domain name

Options

--format <FORMAT>Output format (json or zone) [default: json]

namecheap dns sync import

Import records from a file or stdin, bringing the zone into line with it

Records in the file are added or updated. Records the file does not mention are left alone unless --delete is given, which makes the zone match the file exactly.

namecheap dns sync [OPTIONS] <DOMAIN> [FILE]

Arguments

<DOMAIN>Domain name
[FILE]File to read records from, as JSON or zone text (use - for stdin)
[default: -]

Options

--deleteAlso delete records that the file does not mention

namecheap dns diff

Show diff between current and desired DNS records

namecheap dns diff [OPTIONS] <DOMAIN> [FILE]

Arguments

<DOMAIN>Domain name
[FILE]File with desired records (use - for stdin) [default: -]

Options

--checkExit with code 8 if the records differ, for use in CI

namecheap dns edit

Edit a domain's DNS records in your editor

namecheap dns edit [OPTIONS] <DOMAIN>

Arguments

<DOMAIN>Domain name

Options

--editor <EDITOR>Editor to use (defaults to $VISUAL, then $EDITOR)

namecheap dns rollback

Restore a domain's DNS from a snapshot taken before an earlier change

namecheap dns rollback [OPTIONS] <DOMAIN>

Arguments

<DOMAIN>Domain name

Options

--listShow the available snapshots instead of restoring one
--at <ID>Restore this snapshot instead of the most recent (id from --list)

namecheap dns email

Manage email forwarding for a domain

Forwarding is stored separately from the host records: it never shows up in dns list, and Namecheap only delivers it while the domain's mail routing mode is FWD, which any MX record switches away from.

namecheap dns email [OPTIONS] <COMMAND>

namecheap dns email list

List the forwarded mailboxes on a domain

namecheap dns email list [OPTIONS] <DOMAIN>

Arguments

<DOMAIN>Domain name

namecheap dns email set add

Forward a mailbox to an address, replacing where it went before

namecheap dns email set [OPTIONS] <DOMAIN> <MAILBOX> <FORWARD_TO>

Arguments

<DOMAIN>Domain name
<MAILBOX>Mailbox name, without the domain (use @ to catch everything)
<FORWARD_TO>The address mail is forwarded to

namecheap dns email rm

Stop forwarding a mailbox

namecheap dns email rm [OPTIONS] <DOMAIN> <MAILBOX>

Arguments

<DOMAIN>Domain name
<MAILBOX>Mailbox name, without the domain

namecheap dns clone

Copy DNS records from one domain to one or more others

namecheap dns clone [OPTIONS] <SOURCE> [TARGET]...

Arguments

<SOURCE>Domain to copy records from
[TARGET]...Domains to copy records to

Options

--domains-from <FILE>Read target domains from a file, one per line
-t, --record-type <RECORD_TYPE>Only copy these record types (comma-separated, e.g. A,AAAA)
--host <HOST>Only copy records for this host (use @ for root)
--deleteDelete records on the target that the source does not have