Manage DNS with the CLI
The zcp CLI manages your DNS zones and records from the terminal. This page covers each step:
create a zone, read the name servers to delegate to, add and remove records, and verify the result.
Before You Start
Section titled “Before You Start”- The
zcpCLI installed and authenticated. See the CLI installation guide and CLI Quickstart. - A domain you control at its registrar.
Create a Zone
Section titled “Create a Zone”Add your domain to ZCP. This creates the DNS zone ZSoftly serves.
zcp dns create --name example.com --project default-9Output:
FIELD VALUESlug examplecomName example.comStatus falseCreated 2026-07-18T21:08:26.000000ZZCP generates a slug from the domain name. Every later command addresses the zone by this slug,
not by the domain name. Copy it from this output or from zcp dns list. The Status value turns
active shortly after creation.
Read Your Name Servers
Section titled “Read Your Name Servers”When you create a zone, ZCP adds its SOA and NS records for you. The NS record set holds the
two name servers you point your registrar at.
zcp dns show examplecomOutput:
FIELD VALUESlug examplecomName example.comStatus trueCreated 2026-07-18T21:08:26.000000ZUpdated 2026-07-18T21:08:26.000000Z
Records (2):NAME TYPE CONTENT TTLexample.com. SOA ns1.zsoftly.ca. hostmaster.zsoftly.ca. 2026071801 10800 3600 604800 3600 3600example.com. NS ns1.zsoftly.ca., ns2.zsoftly.ca. 3600Point your registrar at both name servers before you send live traffic. See Domains for the per-registrar steps and the Cloudflare Registrar exception.
Add Records
Section titled “Add Records”Use zcp dns record-create with the zone slug, a relative name, a type, and the content.
# Apex A record (use @ for the zone root)zcp dns record-create --domain examplecom --name @ --type A --content 203.0.113.10
# Subdomain A recordzcp dns record-create --domain examplecom --name www --type A --content 203.0.113.10
# IPv6 addresszcp dns record-create --domain examplecom --name ipv6 --type AAAA --content 2001:db8::10
# Alias one name to anotherzcp dns record-create --domain examplecom --name blog --type CNAME --content www.example.com.
# Text record for SPF or domain verificationzcp dns record-create --domain examplecom --name @ --type TXT --content '"v=spf1 -all"'
# Mail server (MX needs a priority)zcp dns record-create --domain examplecom --name @ --type MX --content mail.example.com. --priority 10Record rules:
- The default TTL is
14400seconds (4 hours). Override it with--ttl, for example--ttl 3600. - Wrap
TXTcontent in escaped quotes, for example'"v=spf1 -all"', so the quotes reach the record. - A
CAAvalue includes a quoted value. Pass the complete value in shell quotes, for example--content '0 issue "letsencrypt.org"'. The CLI rejects a CAA value without its required quotes. - End a
CNAMEtarget with a trailing dot (www.example.com.) to keep it fully qualified. - An
MXrecord needs--priority. Put the mail server in--contentand the preference number in--priority, for example--priority 10. The CLI stops with an error if you leave it off. - Creating a record at a name and type with existing values adds the new value to the set.
- Supported types are
A,AAAA,CAA,CNAME,MX,TXT, andNS. The CLI does not createSRVorLOCrecords yet. Create them in the DNS section of the console or with the API.
By default, record-create prints one row for the value it created. The result includes the name,
type, content, TTL, and, for an MX record, its priority. A priority of 0 is shown as 0.
NAME TYPE CONTENT TTL PRIORITYexample.com. MX mail.example.com. 14400 0Add --show-zone when you need the resulting full zone instead.
zcp dns record-create --domain examplecom --name @ --type MX --content mail.example.com. --priority 0 --show-zone--output json and --output yaml return the same one-record list by default. Use --show-zone
with either format when a script needs the resulting full zone.
List and Show Records
Section titled “List and Show Records”zcp dns show prints the zone and every record it holds.
zcp dns show examplecomRecords (6):NAME TYPE CONTENT TTLwww.example.com. A 203.0.113.10 14400ipv6.example.com. AAAA 2001:db8::10 14400blog.example.com. CNAME www.example.com. 14400example.com. TXT "v=spf1 -all" 14400example.com. SOA ns1.zsoftly.ca. hostmaster.zsoftly.ca. 2026071807 10800 3600 604800 3600 3600example.com. NS ns1.zsoftly.ca., ns2.zsoftly.ca. 3600For scripting, add --output json and pipe to jq.
zcp dns list --output jsonzcp dns show examplecom --output jsonUpdate a Record
Section titled “Update a Record”There is no update command. To change a record, delete it and create it again with the new value.
zcp dns record-delete --domain examplecom --name www --type A --yeszcp dns record-create --domain examplecom --name www --type A --content 203.0.113.20Delete a Record
Section titled “Delete a Record”Address the record set by name and type. The command reads the matching values first, then deletes each value from that initial snapshot.
zcp dns record-delete --domain examplecom --name www --type AAdd --yes to skip the confirmation prompt in scripts. Output:
NAME TYPE CONTENT TTL PRIORITY SOURCEwww.example.com. A 203.0.113.10 14400 - Pre-delete snapshotBy default, the CLI reads the selected record set before deleting it, then lists every value from
that pre-delete snapshot. The SOURCE column identifies this output as Pre-delete snapshot. The
CLI only targets the values from this initial snapshot. A value added after the read is not deleted.
This snapshot is not an authoritative list of values the command removed. If a matching value
changes before deletion, the snapshot can differ from the values removed. The CLI also writes this
warning to standard error.
In JSON and YAML output, each snapshot record has source: pre_delete_snapshot.
[ { "name": "www.example.com.", "type": "A", "content": "203.0.113.10", "ttl": "14400", "priority": "-", "source": "pre_delete_snapshot" }]If the initial read finds no matching values, the command succeeds with an empty result. With
--show-zone, it prints the remaining zone instead.
If one value deletion fails, the command exits with an error and prints no successful deletion
result. Values deleted before the failure remain deleted. Run zcp dns show before retrying so you
can see the remaining values.
If deletion succeeds but the CLI could not read record details beforehand, it returns an empty
result and a warning. --show-zone returns the resulting full zone and does not add snapshot
metadata.
Use relative names or @ for normal record deletion. If a temporary lookup failure prevents the
snapshot, an explicit fully qualified --name ending in a dot, such as www.example.ca., allows a
name-and-type fallback request. This fallback cannot delete values individually and may fail for a
multi-value record set. Authentication and authorization errors still stop the command. Add
--show-zone to print the resulting full zone after deletion instead.
zcp dns record-delete --domain examplecom --name www --type A --show-zoneDelete a Zone
Section titled “Delete a Zone”This removes the zone and all of its records.
zcp dns delete examplecomAdd --yes to skip the confirmation prompt.
Verify
Section titled “Verify”Query the ZSoftly name servers directly to confirm a record before global propagation finishes.
# Ask a ZSoftly name server for the recorddig A www.example.com @ns1.zsoftly.ca +short
# After you delegate at your registrar, query any public resolverdig A www.example.com @1.1.1.1 +shortSee also: DNS Overview, Domains, DNS Records, Worked examples, Manage DNS with the API, Troubleshooting, CLI Reference