List Zones
GET /dns/zones
Responses
- 200 list[ZoneOut]
- 401 no key, or a key that was revoked
- 403 the key lacks the permission
Example request
curl -X GET "$API/dns/zones" \
-H "Authorization: Bearer $LH_API_KEY"
Every call needs Authorization: Bearer lh_… unless marked No key needed; the example uses $API for https://api.localhost.co.zw and $LH_API_KEY for your key. A * marks a required field.
GET /dns/zones
curl -X GET "$API/dns/zones" \
-H "Authorization: Bearer $LH_API_KEY"
GET /dns/zones/{name}/records
| Name | Type | Notes |
|---|---|---|
| name * in path | string |
curl -X GET "$API/dns/zones/<name>/records" \
-H "Authorization: Bearer $LH_API_KEY"
POST /dns/zones/{name}/records
| Name | Type | Notes |
|---|---|---|
| name * in path | string |
| Name | Type | Notes |
|---|---|---|
| name | string | default @ |
| type * | string | |
| content * | string | |
| ttl | integer | default 300 |
| priority | integer | null |
curl -X POST "$API/dns/zones/<name>/records" \
-H "Authorization: Bearer $LH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "<type>",
"content": "<content>"
}'
DELETE /dns/zones/{name}/records
DELETE /dns/zones/{name}/records?id=123
| Name | Type | Notes |
|---|---|---|
| name * in path | string | |
| id * query | integer |
curl -X DELETE "$API/dns/zones/<name>/records?id=<id>" \
-H "Authorization: Bearer $LH_API_KEY"
PUT /dns/zones/{name}/records/{record_id}
Change one record in place (its name, type, content, TTL or priority). Records we keep for email or a website
(managed_by set) can't be changed here.
| Name | Type | Notes |
|---|---|---|
| name * in path | string | |
| record_id * in path | integer |
| Name | Type | Notes |
|---|---|---|
| name | string | default @ |
| type * | string | |
| content * | string | |
| ttl | integer | default 300 |
| priority | integer | null |
curl -X PUT "$API/dns/zones/<name>/records/<record_id>" \
-H "Authorization: Bearer $LH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "<type>",
"content": "<content>"
}'
DELETE /dns/zones/{name}/records/{record_id}
| Name | Type | Notes |
|---|---|---|
| name * in path | string | |
| record_id * in path | integer |
curl -X DELETE "$API/dns/zones/<name>/records/<record_id>" \
-H "Authorization: Bearer $LH_API_KEY"
The objects these endpoints send and receive.
| Name | Type | Notes |
|---|---|---|
| name | string | default @ |
| type * | string | |
| content * | string | |
| ttl | integer | default 300 |
| priority | integer | null |
| Name | Type | Notes |
|---|---|---|
| id * | integer | |
| name * | string | |
| type * | string | |
| content * | string | |
| ttl * | integer | |
| priority * | integer | null | |
| managed_by * | string | |
| editable * | boolean |
| Name | Type | Notes |
|---|---|---|
| name * | string | |
| serial * | integer | |
| records * | integer | |
| synced * | boolean |