Skip to content

List DNS zones

GET /api/v2/dns-zones

Lists the DNS zones on the account. kind is linked when the account also has the domain and dns_only when it has only the zone. Add name=example.com to get only that zone and its public zone_... ID. Use the ID with GET /api/v2/dns-zones/{id} to read the zone’s records.

An API key limited to certain DNS zones sees only those zones. Nameservers are not part of this response. GET /api/v2/domains/{id}/nameservers returns them.

Authentication: An API key with the scope read:dns. About keys and scopes

Request

Query parameters

limitinteger
Zones per page, 1 to 1000. Default 1000. Default 1000. 1 to 1000.
cursorstring
The nextCursor value from the previous page.
namestring
Exact zone name, for example example.com. Unicode and punycode forms both match. Returns only that zone, with its public zone_... ID.

Example

GET /api/v2/dns-zones
curl "https://cloud.hostup.se/api/v2/dns-zones" \
-H "Authorization: Bearer $HOSTUP_API_KEY"

Responses

200 One page of DNS zones, sorted by name.

Response 200
{
"data": [
{
"id": "zone_01hxa3b4c5d6e7f8g9h0j1k2m3",
"name": "example.com",
"status": "active",
"isDnsOnly": false,
"kind": "linked"
}
],
"hasMore": false,
"nextCursor": null
}
Response fields
dataarray of object
idstring
namestring
The zone’s domain name. An internationalised name is in Unicode.
statusstring
active: the zone is served. disabled: switched off. pending: being set up. error: the DNS server reports a fault. unknown: the state could not be read. One of active, disabled, pending, error, unknown.
isDnsOnlyboolean
kindstring
One of dns_only, linked.
recordCountinteger
hasMoreboolean
nextCursorstring or null

Errors

Errors are Problem Details with a stable code. Branch on the code, not on the text.

400invalid_pagination_limit: limit is not a whole number from 1 to 1000. invalid_cursor: cursor is malformed.
401Unauthorized. Authentication is required.
403Forbidden. The caller lacks a required scope or does not own the resource.
404Not found. The resource does not exist or is not owned by the caller.
429Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers.
500Internal error. Retry later or contact support if the issue persists.