Skip to content
Live $100 credit at signup, up to $300 total Offer ends December 31, 2026 Get started →

DNS Examples

Practical recipes for common DNS tasks. Each one uses the zcp CLI against a zone with the slug examplecom, then verifies the result with dig. Read your slug from zcp dns list. The same records work from the console and the API.

Point the root and www at your server.

zcp dns record-create --domain examplecom --name @ --type A --content 203.0.113.10
zcp dns record-create --domain examplecom --name www --type A --content 203.0.113.10

Verify from a public resolver:

dig A example.com +short # 203.0.113.10
dig A www.example.com +short # 203.0.113.10

Add a mail server and an SPF policy. MX takes a priority in its own field.

zcp dns record-create --domain examplecom --name @ --type MX --content mail.example.com. --priority 10
zcp dns record-create --domain examplecom --name @ --type TXT --content '"v=spf1 mx -all"'

Verify:

dig MX example.com +short # 10 mail.example.com.
dig TXT example.com +short # "v=spf1 mx -all"

See MX records and TXT records.

Many services ask you to publish a TXT record to prove you own the domain. Paste the value they give you.

zcp dns record-create --domain examplecom --name @ --type TXT --content '"provider-verification=abc123"'
dig TXT example.com +short

Allow only your certificate authority to issue certificates.

zcp dns record-create --domain examplecom --name @ --type CAA --content '0 issue "letsencrypt.org"'
dig CAA example.com +short # 0 issue "letsencrypt.org"

Hand subzone.example.com to another DNS provider.

zcp dns record-create --domain examplecom --name subzone --type NS --content ns1.other-dns.com.
zcp dns record-create --domain examplecom --name subzone --type NS --content ns2.other-dns.com.
dig NS subzone.example.com +short

There is no update action. Delete the record, then create it with the new value.

zcp dns record-delete --domain examplecom --name www --type A --yes
zcp dns record-create --domain examplecom --name www --type A --content 203.0.113.20

Verify the new value, allowing for the record’s TTL to expire in resolver caches:

dig A www.example.com +short # 203.0.113.20
zcp dns record-delete --domain examplecom --name subzone --type NS

Add --yes to skip the confirmation prompt in scripts.

See also: Record types, Manage DNS with the CLI, Troubleshooting