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.
Supported record types
Section titled “Supported record types”When you create a record you choose its type. Comwit Cloud supports:
| Type | What it does |
|---|---|
A | Points a name at an IPv4 address. |
AAAA | Points a name at an IPv6 address. |
CNAME | Aliases one name to another name. |
TXT | Stores arbitrary text (verification, SPF, etc.). |
MX | Routes mail for the domain. |
A_ALIAS | An 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. |
List records
Section titled “List records”This shows every record in the domain’s zone, including ones Comwit wrote for you.
comwit domains records list --project <project-id> --domain example.comGET /v1/projects/{projectId}/domains/{domain}/recordsWhat a record looks like
Section titled “What a record looks like”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"} }| Field | Meaning |
|---|---|
id | Stable id (dnsrec_...) you pass to update/delete. |
name | The DNS name this record applies to. |
type | One of the supported types above. |
ttl | Time-to-live in seconds. |
values | The record’s value(s) — a list, because some types (like MX) carry several. |
owner | Who controls the record — see below. |
status | Sync state of the record, e.g. in_sync. |
last_error | A sanitized failure message, present only on failed records. |
Record ownership: yours vs. Comwit’s
Section titled “Record ownership: yours vs. Comwit’s”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 carryowner_resource_type: "runtime_app"). See Connect a domain to an app.
Create a record
Section titled “Create a record”comwit domains records create \ --project <project-id> \ --domain example.com \ --name www \ --type CNAME \ --value target.example.net \ --ttl 300POST /v1/projects/{projectId}/domains/{domain}/recordsUpdate a record
Section titled “Update a record”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 domains records update \ --project <project-id> \ --domain example.com \ --record <record-id> \ --value target2.example.net \ --ttl 300PUT /v1/projects/{projectId}/domains/{domain}/records/{recordId}Delete a record
Section titled “Delete a record”comwit domains records delete \ --project <project-id> \ --domain example.com \ --record <record-id>DELETE /v1/projects/{projectId}/domains/{domain}/records/{recordId}Required scopes
Section titled “Required scopes”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.
Related
Section titled “Related”- Bring your own domain — onboard and delegate a domain first.
- Connect a domain to an app — attach an app hostname with Automatic DNS.
- Domains overview — how domains fit together in Comwit Cloud.
- CLI reference — full command surface.