API: DNS
Zone Endpoints
| Method | Path | Description |
|---|
| POST | /v1/dns/zones | Create a DNS zone |
| GET | /v1/dns/zones | List all zones |
| GET | /v1/dns/zones/{id} | Get zone details |
| DELETE | /v1/dns/zones/{id} | Delete a zone |
### Create Zone
{
"metadata": {"name": "example-zone"},
"spec": {
"domain": "example.com",
"dnssec": true
}
}
Record Endpoints
| Method | Path | Description |
|---|
| POST | /v1/dns/records | Create a DNS record |
| GET | /v1/dns/records | List records (filter by ?zone_id=) |
| GET | /v1/dns/records/{id} | Get record details |
| DELETE | /v1/dns/records/{id} | Delete a record |
### Create Record
{
"metadata": {"name": "www-record"},
"spec": {
"zone_id": "zone-abc123",
"name": "www",
"type": "A",
"value": "203.0.113.42",
"ttl": 300
}
}
ZoneSpec Fields
| Field | Type | Required | Description |
|---|
domain | string | Yes | Domain name |
dnssec | bool | No | Enable DNSSEC (default: false) |
## RecordSpec Fields
| Field | Type | Required | Description |
|---|
zone_id | string | Yes | Parent zone ID |
name | string | Yes | Record name (e.g., www, @) |
type | string | Yes | Record type: A, AAAA, CNAME, MX, TXT, SRV, NS |
value | string | Yes | Record value |
ttl | int | No | Time to live in seconds (default: 3600) |
## Example: Full Domain Setup
# Create zone
curl -X POST $API/v1/dns/zones -H "$AUTH" -H "$CT" \
-d '{"metadata":{"name":"my-zone"},"spec":{"domain":"myapp.com","dnssec":true}}'
Create A record
curl -X POST $API/v1/dns/records -H "$AUTH" -H "$CT" \
-d '{"metadata":{"name":"root-a"},"spec":{"zone_id":"zone-xyz","name":"@","type":"A","value":"203.0.113.42","ttl":300}}'
Create CNAME
curl -X POST $API/v1/dns/records -H "$AUTH" -H "$CT" \
-d '{"metadata":{"name":"www-cname"},"spec":{"zone_id":"zone-xyz","name":"www","type":"CNAME","value":"myapp.com","ttl":300}}'