Skip to content

Manage DNS records

A DNS record tells the internet where a name should point — for example, that www.example.com should serve from a particular host. Once you have onboarded a domain so Comwit Cloud manages its DNS (see Bring your own domain), you can manage that domain’s records with the comwit CLI or the platform API.

When you create a record you choose its type. Comwit Cloud supports:

TypeWhat it does
APoints a name at an IPv4 address.
AAAAPoints a name at an IPv6 address.
CNAMEAliases one name to another name.
TXTStores arbitrary text (verification, SPF, etc.).
MXRoutes mail for the domain.
A_ALIASAn apex alias — lets the bare/root domain (e.g. example.com) point at a target the way a CNAME would, which a plain A record at the apex cannot.

This shows every record in the domain’s zone, including ones Comwit wrote for you.

comwit CLI
comwit domains records list --project <project-id> --domain example.com
API
GET /v1/projects/{projectId}/domains/{domain}/records

Each record carries an id, its name, type, TTL, one or more values, and ownership metadata:

{ "record": {
"id": "dnsrec_...",
"name": "www.example.com",
"type": "CNAME",
"ttl": 300,
"values": ["target.example.net"],
"owner": "user",
"status": "in_sync"
} }
FieldMeaning
idStable id (dnsrec_...) you pass to update/delete.
nameThe DNS name this record applies to.
typeOne of the supported types above.
ttlTime-to-live in seconds.
valuesThe record’s value(s) — a list, because some types (like MX) carry several.
ownerWho controls the record — see below.
statusSync state of the record, e.g. in_sync.
last_errorA sanitized failure message, present only on failed records.

Every record has an owner:

  • owner: "user" — records you created and manage. You can freely update or delete these.
  • owner: "platform_app" — records Comwit wrote for you when you attached an app hostname using Automatic DNS (these also carry owner_resource_type: "runtime_app"). See Connect a domain to an app.
comwit CLI
comwit domains records create \
--project <project-id> \
--domain example.com \
--name www \
--type CNAME \
--value target.example.net \
--ttl 300
API
POST /v1/projects/{projectId}/domains/{domain}/records

Updating is partial: any field you leave out is loaded from the existing record. Concretely, if you omit --name, --type, or --ttl, the current value is kept. Supplying one or more --value flags replaces the record’s values.

comwit CLI
comwit domains records update \
--project <project-id> \
--domain example.com \
--record <record-id> \
--value target2.example.net \
--ttl 300
API
PUT /v1/projects/{projectId}/domains/{domain}/records/{recordId}
comwit CLI
comwit domains records delete \
--project <project-id> \
--domain example.com \
--record <record-id>
API
DELETE /v1/projects/{projectId}/domains/{domain}/records/{recordId}

When you call these routes with a cwt_ API token, the token must carry the right scope:

  • domain:read — for list / read.
  • domain:write — for create, update, and delete.

See Authentication for how token scopes work.