DNS
Endpoints for managing DNS zones.
Admins see every zone. Non-admin users see only zones they own.
List Zones
GET /api/v1/dns
Scope: read:dns
Query Parameters
| Parameter | Type | Description |
|---|---|---|
page |
integer | Page number. See Pagination |
limit |
integer | Items per page. See Pagination |
Response
{
"data": [
{
"id": 1,
"name": "example.com",
"type": "NATIVE",
"record_count": 5,
"user_id": 1
}
],
"pagination": {
"page": 1,
"limit": 25,
"total": 1,
"total_pages": 1
}
}
| Field | Type | Description |
|---|---|---|
id |
integer | Zone ID |
name |
string | Zone domain name |
type |
string | Zone type, usually NATIVE |
record_count |
integer | Number of records in the zone |
user_id |
integer | ID of the owning panel user |
Example
curl -H "Authorization: Bearer $TOKEN" \
"https://panel.example.com/api/v1/dns?page=1&limit=25"
Get Zone
GET /api/v1/dns/{zone}
Scope: read:dns
Returns the zone metadata and every record in it.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
zone |
string | Domain name of the zone (not the numeric ID) |
Response
{
"data": {
"zone": {
"id": 1,
"name": "example.com",
"type": "NATIVE",
"record_count": 2,
"user_id": 1
},
"records": [
{
"id": 8,
"domain_id": 1,
"name": "www",
"type": "A",
"content": "192.168.1.50",
"ttl": 3600,
"prio": 0
},
{
"id": 4,
"domain_id": 1,
"name": "@",
"type": "CNAME",
"content": "example.com",
"ttl": 3600,
"prio": 0
}
]
}
}
The zone object has the same shape as an item in the list response.
Record fields
| Field | Type | Description |
|---|---|---|
id |
integer | Record ID |
domain_id |
integer | Zone ID this record belongs to |
name |
string | Hostname part (@ for the zone root, www for a subdomain) |
type |
string | Record type (A, AAAA, CNAME, MX, TXT, NS, etc.) |
content |
string | Record value |
ttl |
integer | Time to live in seconds |
prio |
integer | Priority, used for MX records; 0 otherwise |
Errors
| Code | Status | Condition |
|---|---|---|
not_found |
404 | Zone does not exist |
forbidden |
403 | Zone belongs to another user |
Example
curl -H "Authorization: Bearer $TOKEN" \
https://panel.example.com/api/v1/dns/example.com
Related
- Authentication - token format and auth failures
- Responses - success response shape
- Pagination - list parameters and iteration
- Errors - error codes