Skip to content

Zones

A zone is a domain hosted on Dinio. See DNS hosting.

interface Zone {
uuid: string;
name: string; // "example.com"
has_api_key: boolean; // whether a zone key exists
suspended: boolean; // suspended by Dinio
owner_suspended: boolean; // the Owner's account is suspended
created_at: number; // Unix seconds
updated_at: number;
records?: RecordValue[]; // only with ?include=records
}

Wherever a route takes :ref, use the zone’s uuid or its name.

While suspended or owner_suspended is true, the zone can be read and deleted, and its key revoked, but every other change is refused with 403 SUSPENDED.

GET /api/v1/zones

Zones the key can see: a zone key sees its own zone; a personal key sees the zones where the user is Owner or Administrator. Every zone comes in one response.

Terminal window
curl -H "Authorization: Bearer $DINIO_API_KEY" \
https://api-dinio.bitelex.com/api/v1/zones
POST /api/v1/zones

The caller becomes the zone’s Owner, and the apex SOA and NS records are created with it. Needs a personal key — a zone key gets 403.

Field Type
name string Zone name, e.g. example.com.
Terminal window
curl -X POST -H "Authorization: Bearer $DINIO_API_KEY" -H "Content-Type: application/json" \
-d '{"name":"example.com"}' \
https://api-dinio.bitelex.com/api/v1/zones

Returns 201 with the zone. 409 CONFLICT if the name is taken, 422 for an invalid name.

A zone counts against your package’s auth.zones.max: without an auth package the call is 403 NO_SUBSCRIPTION, at the limit 403 PLAN_LIMIT. Near the limit, the response carries a PLAN_USAGE warning. See Packages and usage.

A name directly below a free domain — myhome.example.net — is a lease: Dinio also adds the delegation to the free domain. A lease that isn’t possible (the name is taken or reserved) is 409 CONFLICT, with the reason in message. Leases count against auth.free_subdomains.max instead of auth.zones.max. Names deeper below a free domain, and the free domain itself, are refused.

GET /api/v1/zones/:ref

Query include=records adds every record value of the zone as records, in the same flat form as List record values.

Terminal window
curl -H "Authorization: Bearer $DINIO_API_KEY" \
"https://api-dinio.bitelex.com/api/v1/zones/example.com?include=records"
POST /api/v1/zones/:ref/api-key

Generates a new zone key and returns it — the only time it is shown. A previous zone key stops working immediately. Allowed for the zone key itself, the Owner and Administrators.

Terminal window
curl -X POST -H "Authorization: Bearer $DINIO_API_KEY" \
https://api-dinio.bitelex.com/api/v1/zones/example.com/api-key
{ "success": true, "data": { "api_key": "dz_3q2-7wEvCzYxQ…" } }

Returns 201.

DELETE /api/v1/zones/:ref/api-key

The zone key stops working immediately. Returns the zone, with has_api_key: false. Same access as issuing one.

Terminal window
curl -X DELETE -H "Authorization: Bearer $DINIO_API_KEY" \
https://api-dinio.bitelex.com/api/v1/zones/example.com/api-key
DELETE /api/v1/zones/:ref

Deletes the zone with everything in it: records, health checks, geo bans, redirects and zone certificates. Deleting a lease also removes its delegation from the free domain. Allowed for the zone key and the Owner, not for Administrators.

Terminal window
curl -X DELETE -H "Authorization: Bearer $DINIO_API_KEY" \
https://api-dinio.bitelex.com/api/v1/zones/example.com

Exporting and importing a zone’s records is described in Zone files.