---
title: "Managed DNS — API reference"
description: "Authoritative DNS on ns1.gyrodns.net (Istanbul) + ns2.gyrodns.net (Germany): zones, records (A/AAAA/CNAME/MX/TXT/SRV/CAA/ALIAS/NS/PTR), BIND import/ex"
url: https://www.gyrohosting.com/developers/en/api/managed-dns.html
language: en
openapi: https://www.gyrohosting.com/developers/openapi.json
api_version: 2.30.0
---

# Managed DNS

Authoritative DNS on ns1.gyrodns.net (Istanbul) + ns2.gyrodns.net (Germany): zones, records (A/AAAA/CNAME/MX/TXT/SRV/CAA/ALIAS/NS/PTR), BIND import/export, one-click DNSSEC, health-checked failover records.

Base URL: `https://www.gyrohosting.com/api/v1/client` · OpenAPI: https://www.gyrohosting.com/developers/openapi.json


## GET /cloud/dns/acme-challenge

**Is the challenge record live?** · operationId `acmeChallengeStatus` · scope `dns_acme` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/acmeChallengeStatus.json

Asks both authoritative name servers (ns1/ns2.gyrodns.net) directly. `ready` is true when both publish `value`. Poll every few seconds after adding (usually < 1 minute).


### Parameters

| Field | in | Type | Description |
|---|---|---|---|
| `name` (required) | query | string | _acme-challenge.<domain> |
| `value` | query | string | Challenge value (key authorization digest) |

### Responses

- **200**: Status
- **401**: Missing, invalid or revoked key
- **403**: zone_not_allowed / action_not_allowed
- **404**: Not found — also returned for objects owned by someone else
- **422**: Validation or business rule failure (`confirm_required`, `invalid_image`, `tool_action_failed` ...)

### Examples

```bash
curl -s 'https://www.gyrohosting.com/api/v1/client/cloud/dns/acme-challenge' \
  -H "Authorization: Bearer $GYRO_TOKEN"
```
```bash
gyro dns acme-challenge status
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.get("https://www.gyrohosting.com/api/v1/client/cloud/dns/acme-challenge", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/dns/acme-challenge", {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
  },
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## POST /cloud/dns/acme-challenge

**Add an ACME challenge TXT value** · operationId `acmeChallengeAdd` · scope `dns_acme` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/acmeChallengeAdd.json

Adds `value` to the TXT record set at `name` (TTL 60); other values stay, so the apex and the wildcard of one certificate can be validated together (max 10 values per name). The service and the zone are found from the name (longest Gyro DNS zone of yours that covers it; hosting/cPanel zones are not supported). Idempotent.


### Request body

| Field | Type | Description |
|---|---|---|
| `name` (required) | string | _acme-challenge.<domain> (for *.example.com: _acme-challenge.example.com) |
| `value` (required) | string | Challenge value (base64url, 16-128 characters) |

### Responses

- **202**: Added
- **401**: Missing, invalid or revoked key
- **403**: zone_not_allowed
- **404**: Not found — also returned for objects owned by someone else
- **409**: State conflict (`server_locked`, `not_actionable`, `ssh_key_exists`, `server_limit`, `idempotency_in_flight`)
- **422**: Validation or business rule failure (`confirm_required`, `invalid_image`, `tool_action_failed` ...)

### Examples

```bash
curl -s -X POST 'https://www.gyrohosting.com/api/v1/client/cloud/dns/acme-challenge' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "_acme-challenge.example.com", "value": "string"}'
```
```bash
gyro dns acme-challenge add --help    # all flags
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.post("https://www.gyrohosting.com/api/v1/client/cloud/dns/acme-challenge", headers=h, json={"name": "_acme-challenge.example.com", "value": "string"}, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/dns/acme-challenge", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"name": "_acme-challenge.example.com", "value": "string"}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## DELETE /cloud/dns/acme-challenge

**Remove an ACME challenge TXT value** · operationId `acmeChallengeRemove` · scope `dns_acme` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/acmeChallengeRemove.json

Removes only `value` (query or JSON body); the record set is deleted when it becomes empty.


### Parameters

| Field | in | Type | Description |
|---|---|---|---|
| `name` (required) | query | string | _acme-challenge.<domain> |
| `value` | query | string | Challenge value (key authorization digest) |

### Responses

- **202**: Removed
- **401**: Missing, invalid or revoked key
- **403**: zone_not_allowed
- **404**: Not found — also returned for objects owned by someone else
- **422**: Validation or business rule failure (`confirm_required`, `invalid_image`, `tool_action_failed` ...)

### Examples

```bash
curl -s -X DELETE 'https://www.gyrohosting.com/api/v1/client/cloud/dns/acme-challenge' \
  -H "Authorization: Bearer $GYRO_TOKEN"
```
```bash
gyro dns acme-challenge remove
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.delete("https://www.gyrohosting.com/api/v1/client/cloud/dns/acme-challenge", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/dns/acme-challenge", {
  method: "DELETE",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
  },
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## GET /cloud/dns/{id}/acme-challenge

**Is the challenge record live? (service)** · operationId `acmeChallengeStatusS` · scope `dns_acme` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/acmeChallengeStatusS.json

Asks both authoritative name servers (ns1/ns2.gyrodns.net) directly. `ready` is true when both publish `value`. Poll every few seconds after adding (usually < 1 minute).


### Parameters

| Field | in | Type | Description |
|---|---|---|---|
| `id` (required) | path | integer | Gyro DNS service id |
| `name` (required) | query | string | _acme-challenge.<domain> |
| `value` | query | string | Challenge value (key authorization digest) |

### Responses

- **200**: Status
- **401**: Missing, invalid or revoked key
- **403**: zone_not_allowed / action_not_allowed
- **404**: Not found — also returned for objects owned by someone else
- **422**: Validation or business rule failure (`confirm_required`, `invalid_image`, `tool_action_failed` ...)

### Examples

```bash
curl -s 'https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/acme-challenge' \
  -H "Authorization: Bearer $GYRO_TOKEN"
```
```bash
gyro dns acme-challenge status-in-service 12345
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.get("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/acme-challenge", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/acme-challenge", {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
  },
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## POST /cloud/dns/{id}/acme-challenge

**Add an ACME challenge TXT value (service)** · operationId `acmeChallengeAddS` · scope `dns_acme` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/acmeChallengeAddS.json

Adds `value` to the TXT record set at `name` (TTL 60); other values stay, so the apex and the wildcard of one certificate can be validated together (max 10 values per name). The service and the zone are found from the name (longest Gyro DNS zone of yours that covers it; hosting/cPanel zones are not supported). Idempotent.


### Parameters

| Field | in | Type | Description |
|---|---|---|---|
| `id` (required) | path | integer | Gyro DNS service id |

### Request body

| Field | Type | Description |
|---|---|---|
| `name` (required) | string | _acme-challenge.<domain> (for *.example.com: _acme-challenge.example.com) |
| `value` (required) | string | Challenge value (base64url, 16-128 characters) |

### Responses

- **202**: Added
- **401**: Missing, invalid or revoked key
- **403**: zone_not_allowed
- **404**: Not found — also returned for objects owned by someone else
- **409**: State conflict (`server_locked`, `not_actionable`, `ssh_key_exists`, `server_limit`, `idempotency_in_flight`)
- **422**: Validation or business rule failure (`confirm_required`, `invalid_image`, `tool_action_failed` ...)

### Examples

```bash
curl -s -X POST 'https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/acme-challenge' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "_acme-challenge.example.com", "value": "string"}'
```
```bash
gyro dns acme-challenge add-in-service 12345 --help    # all flags
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.post("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/acme-challenge", headers=h, json={"name": "_acme-challenge.example.com", "value": "string"}, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/acme-challenge", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"name": "_acme-challenge.example.com", "value": "string"}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## DELETE /cloud/dns/{id}/acme-challenge

**Remove an ACME challenge TXT value (service)** · operationId `acmeChallengeRemoveS` · scope `dns_acme` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/acmeChallengeRemoveS.json

Removes only `value` (query or JSON body); the record set is deleted when it becomes empty.


### Parameters

| Field | in | Type | Description |
|---|---|---|---|
| `id` (required) | path | integer | Gyro DNS service id |
| `name` (required) | query | string | _acme-challenge.<domain> |
| `value` | query | string | Challenge value (key authorization digest) |

### Responses

- **202**: Removed
- **401**: Missing, invalid or revoked key
- **403**: zone_not_allowed
- **404**: Not found — also returned for objects owned by someone else
- **422**: Validation or business rule failure (`confirm_required`, `invalid_image`, `tool_action_failed` ...)

### Examples

```bash
curl -s -X DELETE 'https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/acme-challenge' \
  -H "Authorization: Bearer $GYRO_TOKEN"
```
```bash
gyro dns acme-challenge remove-in-service 12345
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.delete("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/acme-challenge", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/acme-challenge", {
  method: "DELETE",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
  },
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## GET /cloud/dns/{id}/acme-keys

**List ACME keys** · operationId `listAcmeKeys` · scope `services_read` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/listAcmeKeys.json




### Parameters

| Field | in | Type | Description |
|---|---|---|---|
| `id` (required) | path | integer | Gyro DNS service id |

### Responses

- **200**: Keys
- **401**: Missing, invalid or revoked key
- **404**: Not found — also returned for objects owned by someone else

### Examples

```bash
curl -s 'https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/acme-keys' \
  -H "Authorization: Bearer $GYRO_TOKEN"
```
```bash
gyro dns acme-key list 12345
```
```hcl
# resource gyro_dns_acme_key: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/dns_acme_key
# ACME key for Let's Encrypt DNS-01 (wildcard certificates). It can only add/remove _acme-challenge TXT records.
resource "gyro_dns_acme_key" "k8s" {
  service_id = 12345 # Gyro DNS service
  name       = "k8s-prod"
  zones      = ["example.com"]
}

# e.g. hand it to cert-manager
resource "kubernetes_secret" "gyro_acme" {
  metadata {
    name      = "gyro-acme"
    namespace = "cert-manager"
  }
  data = { token = gyro_dns_acme_key.k8s.token }
}
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.get("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/acme-keys", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/acme-keys", {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
  },
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## POST /cloud/dns/{id}/acme-keys

**Create an ACME key** · operationId `createAcmeKey` · scope `services_write` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/createAcmeKey.json

A key for certificate automation that can only add/remove `_acme-challenge` TXT records (scope `dns_acme`), optionally only in `zones` and only from `ips`. It cannot read zones, change other records or reach any other endpoint. The token is returned once. Max 10 per service.


### Parameters

| Field | in | Type | Description |
|---|---|---|---|
| `id` (required) | path | integer | Gyro DNS service id |

### Request body

| Field | Type | Description |
|---|---|---|
| `name` | string | Label (e.g. web-01) |
| `zones` | array<string> | Allowed zones (empty = all zones of the service) |
| `ips` | array<string> | Allowed client IPs (empty = any) |

### Responses

- **201**: Created (token shown once)
- **401**: Missing, invalid or revoked key
- **403**: subkey_forbidden
- **404**: Not found — also returned for objects owned by someone else
- **422**: Validation or business rule failure (`confirm_required`, `invalid_image`, `tool_action_failed` ...)

### Examples

```bash
curl -s -X POST 'https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/acme-keys' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "string", "zones": ["string"], "ips": ["string"]}'
```
```bash
gyro dns acme-key create 12345 --help    # all flags
```
```hcl
# resource gyro_dns_acme_key: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/dns_acme_key
# ACME key for Let's Encrypt DNS-01 (wildcard certificates). It can only add/remove _acme-challenge TXT records.
resource "gyro_dns_acme_key" "k8s" {
  service_id = 12345 # Gyro DNS service
  name       = "k8s-prod"
  zones      = ["example.com"]
}

# e.g. hand it to cert-manager
resource "kubernetes_secret" "gyro_acme" {
  metadata {
    name      = "gyro-acme"
    namespace = "cert-manager"
  }
  data = { token = gyro_dns_acme_key.k8s.token }
}
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.post("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/acme-keys", headers=h, json={"name": "string", "zones": ["string"], "ips": ["string"]}, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/acme-keys", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"name": "string", "zones": ["string"], "ips": ["string"]}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## DELETE /cloud/dns/{id}/acme-keys/{kid}

**Delete an ACME key** · operationId `deleteAcmeKey` · scope `services_write` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/deleteAcmeKey.json

Revokes the key at once.


### Parameters

| Field | in | Type | Description |
|---|---|---|---|
| `id` (required) | path | integer | Gyro DNS service id |
| `kid` (required) | path | integer | ACME key id |

### Responses

- **200**: Deleted
- **401**: Missing, invalid or revoked key
- **404**: Not found — also returned for objects owned by someone else

### Examples

```bash
curl -s -X DELETE 'https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/acme-keys/1' \
  -H "Authorization: Bearer $GYRO_TOKEN"
```
```bash
gyro dns acme-key delete 12345
```
```hcl
# resource gyro_dns_acme_key: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/dns_acme_key
# ACME key for Let's Encrypt DNS-01 (wildcard certificates). It can only add/remove _acme-challenge TXT records.
resource "gyro_dns_acme_key" "k8s" {
  service_id = 12345 # Gyro DNS service
  name       = "k8s-prod"
  zones      = ["example.com"]
}

# e.g. hand it to cert-manager
resource "kubernetes_secret" "gyro_acme" {
  metadata {
    name      = "gyro-acme"
    namespace = "cert-manager"
  }
  data = { token = gyro_dns_acme_key.k8s.token }
}
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.delete("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/acme-keys/1", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/acme-keys/1", {
  method: "DELETE",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
  },
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## GET /cloud/dns/{id}/zones

**List DNS zones** · operationId `typed_get_dns__id__zones` · scope `services_read` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/typed_get_dns__id__zones.json

Zones of this DNS service (`items`, state active|pending with the TXT verification token), read-only zones copied from your cPanel hosting (`cpanel`), plan limits and our name servers.


### Parameters

| Field | in | Type | Description |
|---|---|---|---|
| `id` (required) | path | integer | Service id |

### Responses

- **200**: Tool data / result
- **404**: Not found — also returned for objects owned by someone else
- **409**: State conflict (`server_locked`, `not_actionable`, `ssh_key_exists`, `server_limit`, `idempotency_in_flight`)
- **422**: Validation or business rule failure (`confirm_required`, `invalid_image`, `tool_action_failed` ...)

### Examples

```bash
curl -s 'https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/zones' \
  -H "Authorization: Bearer $GYRO_TOKEN"
```
```bash
gyro dns zone list 12345
```
```hcl
# resource gyro_dns_zone: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/dns_zone
resource "gyro_dns_zone" "example" {
  service_id = 789 # Gyro DNS service
  name       = "example.com"
  dnssec     = true
}

# Point the domain to the name servers (or create the TXT record) to activate the zone
output "nameservers" { value = gyro_dns_zone.example.nameservers }
output "verify_txt" { value = "${gyro_dns_zone.example.verification_txt_name} = ${gyro_dns_zone.example.verification_txt_value}" }
output "ds" { value = gyro_dns_zone.example.ds_records }
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.get("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/zones", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/zones", {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
  },
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## POST /cloud/dns/{id}/zones

**Add a zone** · operationId `typed_post_dns__id__zones` · scope `services_write` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/typed_post_dns__id__zones.json

Claims a domain. It is published on ns1/ns2.gyrodns.net after ownership is verified: delegation to our name servers (immediate when already delegated) or the TXT record `_gyrodns-dogrulama.<zone>` = `txt_value` at your current DNS. Optional `bind` (zone file) is imported on activation (SOA and apex NS are ignored).


### Parameters

| Field | in | Type | Description |
|---|---|---|---|
| `id` (required) | path | integer | Service id |

### Request body

| Field | Type | Description |
|---|---|---|
| `name` (required) | string | Zone name (IDN allowed) |
| `bind` | string | Optional BIND zone file (max 2 MB) |
| `confirm` | boolean |  |

### Responses

- **202**: Tool data / result
- **404**: Not found — also returned for objects owned by someone else
- **409**: State conflict (`server_locked`, `not_actionable`, `ssh_key_exists`, `server_limit`, `idempotency_in_flight`)
- **422**: Validation or business rule failure (`confirm_required`, `invalid_image`, `tool_action_failed` ...)

### Examples

```bash
curl -s -X POST 'https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/zones' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "string", "bind": "string", "confirm": true}'
```
```bash
gyro dns zone create 12345 --help    # all flags
```
```hcl
# resource gyro_dns_zone: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/dns_zone
resource "gyro_dns_zone" "example" {
  service_id = 789 # Gyro DNS service
  name       = "example.com"
  dnssec     = true
}

# Point the domain to the name servers (or create the TXT record) to activate the zone
output "nameservers" { value = gyro_dns_zone.example.nameservers }
output "verify_txt" { value = "${gyro_dns_zone.example.verification_txt_name} = ${gyro_dns_zone.example.verification_txt_value}" }
output "ds" { value = gyro_dns_zone.example.ds_records }
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.post("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/zones", headers=h, json={"name": "string", "bind": "string", "confirm": True}, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/zones", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"name": "string", "bind": "string", "confirm": true}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## GET /cloud/dns/{id}/zones/{zone}

**Get a zone with its records** · operationId `typed_get_dns__id__zones__zone` · scope `services_read` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/typed_get_dns__id__zones__zone.json

Zone state, serial, DNSSEC flag (+DS) and all record sets. Pending zones return the verification details.


### Parameters

| Field | in | Type | Description |
|---|---|---|---|
| `id` (required) | path | integer | Service id |
| `zone` (required) | path | string | Zone name |

### Responses

- **200**: Tool data / result
- **404**: Not found — also returned for objects owned by someone else
- **409**: State conflict (`server_locked`, `not_actionable`, `ssh_key_exists`, `server_limit`, `idempotency_in_flight`)
- **422**: Validation or business rule failure (`confirm_required`, `invalid_image`, `tool_action_failed` ...)

### Examples

```bash
curl -s 'https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/zones/1' \
  -H "Authorization: Bearer $GYRO_TOKEN"
```
```bash
gyro dns zone get 12345
```
```hcl
# resource gyro_dns_zone: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/dns_zone
resource "gyro_dns_zone" "example" {
  service_id = 789 # Gyro DNS service
  name       = "example.com"
  dnssec     = true
}

# Point the domain to the name servers (or create the TXT record) to activate the zone
output "nameservers" { value = gyro_dns_zone.example.nameservers }
output "verify_txt" { value = "${gyro_dns_zone.example.verification_txt_name} = ${gyro_dns_zone.example.verification_txt_value}" }
output "ds" { value = gyro_dns_zone.example.ds_records }
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.get("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/zones/1", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/zones/1", {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
  },
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## DELETE /cloud/dns/{id}/zones/{zone}

**Delete a zone** · operationId `typed_delete_dns__id__zones__zone` · scope `services_write` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/typed_delete_dns__id__zones__zone.json

Removes the zone and its health checks from our name servers at once. Needs `"confirm": true`.


### Parameters

| Field | in | Type | Description |
|---|---|---|---|
| `id` (required) | path | integer | Service id |
| `zone` (required) | path | string | Zone name |

### Request body

| Field | Type | Description |
|---|---|---|
| `confirm` | boolean |  |

### Responses

- **202**: Tool data / result
- **404**: Not found — also returned for objects owned by someone else
- **409**: State conflict (`server_locked`, `not_actionable`, `ssh_key_exists`, `server_limit`, `idempotency_in_flight`)
- **422**: Validation or business rule failure (`confirm_required`, `invalid_image`, `tool_action_failed` ...)

### Examples

```bash
curl -s -X DELETE 'https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/zones/1' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"confirm": true}'
```
```bash
gyro dns zone delete 12345 --help    # all flags
```
```hcl
# resource gyro_dns_zone: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/dns_zone
resource "gyro_dns_zone" "example" {
  service_id = 789 # Gyro DNS service
  name       = "example.com"
  dnssec     = true
}

# Point the domain to the name servers (or create the TXT record) to activate the zone
output "nameservers" { value = gyro_dns_zone.example.nameservers }
output "verify_txt" { value = "${gyro_dns_zone.example.verification_txt_name} = ${gyro_dns_zone.example.verification_txt_value}" }
output "ds" { value = gyro_dns_zone.example.ds_records }
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.delete("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/zones/1", headers=h, json={"confirm": True}, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/zones/1", {
  method: "DELETE",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"confirm": true}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## POST /cloud/dns/{id}/zones/{zone}/verify

**Verify ownership now** · operationId `typed_post_dns__id__zones__zone__verify` · scope `services_write` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/typed_post_dns__id__zones__zone__verify.json

Checks delegation / TXT now (the system also re-checks automatically for 14 days).


### Parameters

| Field | in | Type | Description |
|---|---|---|---|
| `id` (required) | path | integer | Service id |
| `zone` (required) | path | string | Zone name |

### Request body

| Field | Type | Description |
|---|---|---|
| `confirm` | boolean |  |

### Responses

- **202**: Tool data / result
- **404**: Not found — also returned for objects owned by someone else
- **409**: State conflict (`server_locked`, `not_actionable`, `ssh_key_exists`, `server_limit`, `idempotency_in_flight`)
- **422**: Validation or business rule failure (`confirm_required`, `invalid_image`, `tool_action_failed` ...)

### Examples

```bash
curl -s -X POST 'https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/zones/1/verify' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"confirm": true}'
```
```bash
gyro dns zone verify 12345 --help    # all flags
```
```hcl
# resource gyro_dns_zone: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/dns_zone
resource "gyro_dns_zone" "example" {
  service_id = 789 # Gyro DNS service
  name       = "example.com"
  dnssec     = true
}

# Point the domain to the name servers (or create the TXT record) to activate the zone
output "nameservers" { value = gyro_dns_zone.example.nameservers }
output "verify_txt" { value = "${gyro_dns_zone.example.verification_txt_name} = ${gyro_dns_zone.example.verification_txt_value}" }
output "ds" { value = gyro_dns_zone.example.ds_records }
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.post("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/zones/1/verify", headers=h, json={"confirm": True}, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/zones/1/verify", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"confirm": true}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## POST /cloud/dns/{id}/zones/{zone}/import

**Import a BIND zone file** · operationId `typed_post_dns__id__zones__zone__import` · scope `services_write` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/typed_post_dns__id__zones__zone__import.json

`merge` replaces record sets present in the file and keeps the others; `replace` also deletes record sets not in the file. SOA and apex NS are ignored; unsupported types are listed in `skipped`. Needs `"confirm": true`.


### Parameters

| Field | in | Type | Description |
|---|---|---|---|
| `id` (required) | path | integer | Service id |
| `zone` (required) | path | string | Zone name |

### Request body

| Field | Type | Description |
|---|---|---|
| `bind` (required) | string |  |
| `mode` | string (merge, replace) |  |
| `confirm` | boolean |  |

### Responses

- **202**: Tool data / result
- **404**: Not found — also returned for objects owned by someone else
- **409**: State conflict (`server_locked`, `not_actionable`, `ssh_key_exists`, `server_limit`, `idempotency_in_flight`)
- **422**: Validation or business rule failure (`confirm_required`, `invalid_image`, `tool_action_failed` ...)

### Examples

```bash
curl -s -X POST 'https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/zones/1/import' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"bind": "string", "mode": "merge", "confirm": true}'
```
```bash
gyro dns zone import 12345 --help    # all flags
```
```hcl
# resource gyro_dns_zone: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/dns_zone
resource "gyro_dns_zone" "example" {
  service_id = 789 # Gyro DNS service
  name       = "example.com"
  dnssec     = true
}

# Point the domain to the name servers (or create the TXT record) to activate the zone
output "nameservers" { value = gyro_dns_zone.example.nameservers }
output "verify_txt" { value = "${gyro_dns_zone.example.verification_txt_name} = ${gyro_dns_zone.example.verification_txt_value}" }
output "ds" { value = gyro_dns_zone.example.ds_records }
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.post("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/zones/1/import", headers=h, json={"bind": "string", "mode": "merge", "confirm": True}, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/zones/1/import", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"bind": "string", "mode": "merge", "confirm": true}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## GET /cloud/dns/{id}/zones/{zone}/export

**Export the zone file** · operationId `typed_get_dns__id__zones__zone__export` · scope `services_read` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/typed_get_dns__id__zones__zone__export.json

Returns the zone in BIND format (`bind`).


### Parameters

| Field | in | Type | Description |
|---|---|---|---|
| `id` (required) | path | integer | Service id |
| `zone` (required) | path | string | Zone name |

### Responses

- **200**: Tool data / result
- **404**: Not found — also returned for objects owned by someone else
- **409**: State conflict (`server_locked`, `not_actionable`, `ssh_key_exists`, `server_limit`, `idempotency_in_flight`)
- **422**: Validation or business rule failure (`confirm_required`, `invalid_image`, `tool_action_failed` ...)

### Examples

```bash
curl -s 'https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/zones/1/export' \
  -H "Authorization: Bearer $GYRO_TOKEN"
```
```bash
gyro dns zone export 12345
```
```hcl
# resource gyro_dns_zone: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/dns_zone
resource "gyro_dns_zone" "example" {
  service_id = 789 # Gyro DNS service
  name       = "example.com"
  dnssec     = true
}

# Point the domain to the name servers (or create the TXT record) to activate the zone
output "nameservers" { value = gyro_dns_zone.example.nameservers }
output "verify_txt" { value = "${gyro_dns_zone.example.verification_txt_name} = ${gyro_dns_zone.example.verification_txt_value}" }
output "ds" { value = gyro_dns_zone.example.ds_records }
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.get("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/zones/1/export", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/zones/1/export", {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
  },
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## GET /cloud/dns/{id}/zones/{zone}/records

**List record sets** · operationId `typed_get_dns__id__zones__zone__records` · scope `services_read` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/typed_get_dns__id__zones__zone__records.json

All record sets (`rrsets`: name, type, ttl, records, read_only, health_check). `source=cpanel` reads a zone of your cPanel hosting (read only).


### Parameters

| Field | in | Type | Description |
|---|---|---|---|
| `id` (required) | path | integer | Service id |
| `zone` (required) | path | string | Zone name |
| `source` | query | string | gyrodns (default) / cpanel |

### Responses

- **200**: Tool data / result
- **404**: Not found — also returned for objects owned by someone else
- **409**: State conflict (`server_locked`, `not_actionable`, `ssh_key_exists`, `server_limit`, `idempotency_in_flight`)
- **422**: Validation or business rule failure (`confirm_required`, `invalid_image`, `tool_action_failed` ...)

### Examples

```bash
curl -s 'https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/zones/1/records' \
  -H "Authorization: Bearer $GYRO_TOKEN"
```
```bash
gyro dns rrset list 12345
```
```hcl
# resource gyro_dns_record: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/dns_record
resource "gyro_dns_record" "www" {
  service_id = gyro_dns_zone.example.service_id
  zone       = gyro_dns_zone.example.name
  name       = "www"
  type       = "A"
  ttl        = 300
  records    = [gyro_server.web.ipv4]
}

resource "gyro_dns_record" "mx" {
  service_id = gyro_dns_zone.example.service_id
  zone       = gyro_dns_zone.example.name
  name       = "@"
  type       = "MX"
  records    = ["10 mx1.example.com.", "20 mx2.example.com."]
}
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.get("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/zones/1/records", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/zones/1/records", {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
  },
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## PUT /cloud/dns/{id}/zones/{zone}/records

**Create or replace a record set** · operationId `typed_put_dns__id__zones__zone__records` · scope `services_write` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/typed_put_dns__id__zones__zone__records.json

Upserts one record set (name + type). CNAME and ALIAS take one value; no CNAME at the apex (use ALIAS); apex NS and SOA are managed by us.


### Parameters

| Field | in | Type | Description |
|---|---|---|---|
| `id` (required) | path | integer | Service id |
| `zone` (required) | path | string | Zone name |

### Request body

| Field | Type | Description |
|---|---|---|
| `name` (required) | string | Record name relative to the zone (@ = apex, * = wildcard) or FQDN with trailing dot |
| `type` (required) | string (A, AAAA, CNAME, MX, TXT, SRV, CAA, ALIAS, NS, PTR) |  |
| `ttl` | integer | 60-86400 s |
| `records` (required) | array<string> | Values in zone file syntax, one per item (TXT quotes optional) |
| `confirm` | boolean |  |

### Responses

- **202**: Tool data / result
- **404**: Not found — also returned for objects owned by someone else
- **409**: State conflict (`server_locked`, `not_actionable`, `ssh_key_exists`, `server_limit`, `idempotency_in_flight`)
- **422**: Validation or business rule failure (`confirm_required`, `invalid_image`, `tool_action_failed` ...)

### Examples

```bash
curl -s -X PUT 'https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/zones/1/records' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "string", "type": "A", "ttl": 1, "records": ["string"], "confirm": true}'
```
```bash
gyro dns rrset set 12345 --help    # all flags
```
```hcl
# resource gyro_dns_record: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/dns_record
resource "gyro_dns_record" "www" {
  service_id = gyro_dns_zone.example.service_id
  zone       = gyro_dns_zone.example.name
  name       = "www"
  type       = "A"
  ttl        = 300
  records    = [gyro_server.web.ipv4]
}

resource "gyro_dns_record" "mx" {
  service_id = gyro_dns_zone.example.service_id
  zone       = gyro_dns_zone.example.name
  name       = "@"
  type       = "MX"
  records    = ["10 mx1.example.com.", "20 mx2.example.com."]
}
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.put("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/zones/1/records", headers=h, json={"name": "string", "type": "A", "ttl": 1, "records": ["string"], "confirm": True}, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/zones/1/records", {
  method: "PUT",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"name": "string", "type": "A", "ttl": 1, "records": ["string"], "confirm": true}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## DELETE /cloud/dns/{id}/zones/{zone}/records

**Delete a record set** · operationId `typed_delete_dns__id__zones__zone__records` · scope `services_write` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/typed_delete_dns__id__zones__zone__records.json

Deletes the record set given by `name` and `type` (query). Needs `"confirm": true`.


### Parameters

| Field | in | Type | Description |
|---|---|---|---|
| `id` (required) | path | integer | Service id |
| `zone` (required) | path | string | Zone name |
| `name` | query | string | Record name |
| `type` | query | string | Record type |

### Request body

| Field | Type | Description |
|---|---|---|
| `confirm` | boolean |  |

### Responses

- **202**: Tool data / result
- **404**: Not found — also returned for objects owned by someone else
- **409**: State conflict (`server_locked`, `not_actionable`, `ssh_key_exists`, `server_limit`, `idempotency_in_flight`)
- **422**: Validation or business rule failure (`confirm_required`, `invalid_image`, `tool_action_failed` ...)

### Examples

```bash
curl -s -X DELETE 'https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/zones/1/records' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"confirm": true}'
```
```bash
gyro dns rrset delete 12345 --help    # all flags
```
```hcl
# resource gyro_dns_record: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/dns_record
resource "gyro_dns_record" "www" {
  service_id = gyro_dns_zone.example.service_id
  zone       = gyro_dns_zone.example.name
  name       = "www"
  type       = "A"
  ttl        = 300
  records    = [gyro_server.web.ipv4]
}

resource "gyro_dns_record" "mx" {
  service_id = gyro_dns_zone.example.service_id
  zone       = gyro_dns_zone.example.name
  name       = "@"
  type       = "MX"
  records    = ["10 mx1.example.com.", "20 mx2.example.com."]
}
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.delete("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/zones/1/records", headers=h, json={"confirm": True}, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/zones/1/records", {
  method: "DELETE",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"confirm": true}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## GET /cloud/dns/{id}/zones/{zone}/dnssec

**DNSSEC status and DS records** · operationId `typed_get_dns__id__zones__zone__dnssec` · scope `services_read` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/typed_get_dns__id__zones__zone__dnssec.json

`dnssec` flag and `ds` (enter at your registrar).


### Parameters

| Field | in | Type | Description |
|---|---|---|---|
| `id` (required) | path | integer | Service id |
| `zone` (required) | path | string | Zone name |

### Responses

- **200**: Tool data / result
- **404**: Not found — also returned for objects owned by someone else
- **409**: State conflict (`server_locked`, `not_actionable`, `ssh_key_exists`, `server_limit`, `idempotency_in_flight`)
- **422**: Validation or business rule failure (`confirm_required`, `invalid_image`, `tool_action_failed` ...)

### Examples

```bash
curl -s 'https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/zones/1/dnssec' \
  -H "Authorization: Bearer $GYRO_TOKEN"
```
```bash
gyro dns dnssec status 12345
```
```hcl
# resource gyro_dns_zone: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/dns_zone
resource "gyro_dns_zone" "example" {
  service_id = 789 # Gyro DNS service
  name       = "example.com"
  dnssec     = true
}

# Point the domain to the name servers (or create the TXT record) to activate the zone
output "nameservers" { value = gyro_dns_zone.example.nameservers }
output "verify_txt" { value = "${gyro_dns_zone.example.verification_txt_name} = ${gyro_dns_zone.example.verification_txt_value}" }
output "ds" { value = gyro_dns_zone.example.ds_records }
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.get("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/zones/1/dnssec", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/zones/1/dnssec", {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
  },
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## POST /cloud/dns/{id}/zones/{zone}/dnssec

**Enable DNSSEC** · operationId `typed_post_dns__id__zones__zone__dnssec` · scope `services_write` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/typed_post_dns__id__zones__zone__dnssec.json

Signs the zone (ECDSA P-256) and returns the DS records. No effect until the DS is at the registrar. Not with ALIAS records.


### Parameters

| Field | in | Type | Description |
|---|---|---|---|
| `id` (required) | path | integer | Service id |
| `zone` (required) | path | string | Zone name |

### Request body

| Field | Type | Description |
|---|---|---|
| `confirm` | boolean |  |

### Responses

- **202**: Tool data / result
- **404**: Not found — also returned for objects owned by someone else
- **409**: State conflict (`server_locked`, `not_actionable`, `ssh_key_exists`, `server_limit`, `idempotency_in_flight`)
- **422**: Validation or business rule failure (`confirm_required`, `invalid_image`, `tool_action_failed` ...)

### Examples

```bash
curl -s -X POST 'https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/zones/1/dnssec' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"confirm": true}'
```
```bash
gyro dns dnssec enable 12345 --help    # all flags
```
```hcl
# resource gyro_dns_zone: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/dns_zone
resource "gyro_dns_zone" "example" {
  service_id = 789 # Gyro DNS service
  name       = "example.com"
  dnssec     = true
}

# Point the domain to the name servers (or create the TXT record) to activate the zone
output "nameservers" { value = gyro_dns_zone.example.nameservers }
output "verify_txt" { value = "${gyro_dns_zone.example.verification_txt_name} = ${gyro_dns_zone.example.verification_txt_value}" }
output "ds" { value = gyro_dns_zone.example.ds_records }
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.post("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/zones/1/dnssec", headers=h, json={"confirm": True}, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/zones/1/dnssec", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"confirm": true}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## DELETE /cloud/dns/{id}/zones/{zone}/dnssec

**Disable DNSSEC** · operationId `typed_delete_dns__id__zones__zone__dnssec` · scope `services_write` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/typed_delete_dns__id__zones__zone__dnssec.json

Remove the DS at your registrar and wait for its TTL first, otherwise validating resolvers fail. Needs `"confirm": true`.


### Parameters

| Field | in | Type | Description |
|---|---|---|---|
| `id` (required) | path | integer | Service id |
| `zone` (required) | path | string | Zone name |

### Request body

| Field | Type | Description |
|---|---|---|
| `confirm` | boolean |  |

### Responses

- **202**: Tool data / result
- **404**: Not found — also returned for objects owned by someone else
- **409**: State conflict (`server_locked`, `not_actionable`, `ssh_key_exists`, `server_limit`, `idempotency_in_flight`)
- **422**: Validation or business rule failure (`confirm_required`, `invalid_image`, `tool_action_failed` ...)

### Examples

```bash
curl -s -X DELETE 'https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/zones/1/dnssec' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"confirm": true}'
```
```bash
gyro dns dnssec disable 12345 --help    # all flags
```
```hcl
# resource gyro_dns_zone: https://registry.terraform.io/providers/gyro-hosting/gyro/latest/docs/resources/dns_zone
resource "gyro_dns_zone" "example" {
  service_id = 789 # Gyro DNS service
  name       = "example.com"
  dnssec     = true
}

# Point the domain to the name servers (or create the TXT record) to activate the zone
output "nameservers" { value = gyro_dns_zone.example.nameservers }
output "verify_txt" { value = "${gyro_dns_zone.example.verification_txt_name} = ${gyro_dns_zone.example.verification_txt_value}" }
output "ds" { value = gyro_dns_zone.example.ds_records }
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.delete("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/zones/1/dnssec", headers=h, json={"confirm": True}, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/zones/1/dnssec", {
  method: "DELETE",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"confirm": true}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## GET /cloud/dns/{id}/health-checks

**List health-checked records** · operationId `typed_get_dns__id__health_checks` · scope `services_read` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/typed_get_dns__id__health_checks.json

Checks with primary/backup IP, which one is active and the last state (gmon majority of 3 locations).


### Parameters

| Field | in | Type | Description |
|---|---|---|---|
| `id` (required) | path | integer | Service id |

### Responses

- **200**: Tool data / result
- **404**: Not found — also returned for objects owned by someone else
- **409**: State conflict (`server_locked`, `not_actionable`, `ssh_key_exists`, `server_limit`, `idempotency_in_flight`)
- **422**: Validation or business rule failure (`confirm_required`, `invalid_image`, `tool_action_failed` ...)

### Examples

```bash
curl -s 'https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/health-checks' \
  -H "Authorization: Bearer $GYRO_TOKEN"
```
```bash
gyro dns health list 12345
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.get("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/health-checks", headers=h, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/health-checks", {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
  },
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## POST /cloud/dns/{id}/health-checks

**Create a health-checked record** · operationId `typed_post_dns__id__health_checks` · scope `services_write` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/typed_post_dns__id__health_checks.json

Points `name` (A/AAAA) to `primary`; when the check fails from the majority of locations the record switches to `backup`, and back after 3 good passes. Uses one health-check add-on unit.


### Parameters

| Field | in | Type | Description |
|---|---|---|---|
| `id` (required) | path | integer | Service id |

### Request body

| Field | Type | Description |
|---|---|---|
| `zone` (required) | string |  |
| `name` (required) | string |  |
| `type` (required) | string (A, AAAA) |  |
| `primary` (required) | string |  |
| `backup` (required) | string |  |
| `check` (required) | string (http, https, tcp, ping) |  |
| `port` | integer |  |
| `path` | string |  |
| `ttl` | integer | 30-300 s |
| `confirm` | boolean |  |

### Responses

- **202**: Tool data / result
- **404**: Not found — also returned for objects owned by someone else
- **409**: State conflict (`server_locked`, `not_actionable`, `ssh_key_exists`, `server_limit`, `idempotency_in_flight`)
- **422**: Validation or business rule failure (`confirm_required`, `invalid_image`, `tool_action_failed` ...)

### Examples

```bash
curl -s -X POST 'https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/health-checks' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"zone": "string", "name": "string", "type": "A", "primary": "string", "backup": "string", "check": "http", "port": 1, "path": "string", "ttl": 1, "confirm": true}'
```
```bash
gyro dns health create 12345 --help    # all flags
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.post("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/health-checks", headers=h, json={"zone": "string", "name": "string", "type": "A", "primary": "string", "backup": "string", "check": "http", "port": 1, "path": "string", "ttl": 1, "confirm": True}, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/health-checks", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"zone": "string", "name": "string", "type": "A", "primary": "string", "backup": "string", "check": "http", "port": 1, "path": "string", "ttl": 1, "confirm": true}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```


## DELETE /cloud/dns/{id}/health-checks/{hid}

**Delete a health check** · operationId `typed_delete_dns__id__health_checks__hid` · scope `services_write` · OpenAPI fragment: https://www.gyrohosting.com/developers/spec/ops/typed_delete_dns__id__health_checks__hid.json

Stops checking; the record keeps its current value. Needs `"confirm": true`.


### Parameters

| Field | in | Type | Description |
|---|---|---|---|
| `id` (required) | path | integer | Service id |
| `hid` (required) | path | string | Health check id |

### Request body

| Field | Type | Description |
|---|---|---|
| `confirm` | boolean |  |

### Responses

- **202**: Tool data / result
- **404**: Not found — also returned for objects owned by someone else
- **409**: State conflict (`server_locked`, `not_actionable`, `ssh_key_exists`, `server_limit`, `idempotency_in_flight`)
- **422**: Validation or business rule failure (`confirm_required`, `invalid_image`, `tool_action_failed` ...)

### Examples

```bash
curl -s -X DELETE 'https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/health-checks/1' \
  -H "Authorization: Bearer $GYRO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"confirm": true}'
```
```bash
gyro dns health delete 12345 --help    # all flags
```
```python
import os, uuid, requests

h = {"Authorization": "Bearer " + os.environ["GYRO_TOKEN"]}
r = requests.delete("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/health-checks/1", headers=h, json={"confirm": True}, timeout=60)
r.raise_for_status()
print(r.json()["data"])
```
```js
const res = await fetch("https://www.gyrohosting.com/api/v1/client/cloud/dns/12345/health-checks/1", {
  method: "DELETE",
  headers: {
    "Authorization": `Bearer ${process.env.GYRO_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"confirm": true}),
});
const { data, error } = await res.json();
if (!res.ok) throw new Error(`${error.code}: ${error.message}`);
```
