# Client — DNS

<a id="get-api-v1-client-dns-domain"></a>
#### `GET /api/v1/client/dns/{domain}`

*Get DNS zone (client)*

Return the DNS zone and its records for a domain owned by the authenticated client.

**Path parameters:**

| Name | Type | Required | Notes |
|------|------|----------|-------|
| `domain` | string | yes | — |

**Responses:**

| Status | Schema | Description |
|--------|--------|-------------|
| `200` | `ApiSuccess_dict_str__Any__` | Successful Response |
| `422` | `HTTPValidationError` | Validation Error |

**Response example (200):**

```json
{
  "data": {},
  "message": "",
  "status": "success",
  "warnings": [
    "string"
  ]
}
```

**cURL example:**

```bash
curl -X GET \
  -H "X-WHost-Key: $WHOST_API_KEY" \
  -H "X-WHost-Timestamp: $(date +%s)" \
  -H "X-WHost-Nonce: $(openssl rand -hex 16)" \
  -H "X-WHost-Signature: $(compute_hmac)" \
  https://your-server:2000/api/v1/client/dns/{domain}
```

---

<a id="get-api-v1-client-dns-domain-dnssec"></a>
#### `GET /api/v1/client/dns/{domain}/dnssec`

*Get DNSSEC status (client)*

Return DNSSEC status for a domain owned by the authenticated client.

**Path parameters:**

| Name | Type | Required | Notes |
|------|------|----------|-------|
| `domain` | string | yes | — |

**Responses:**

| Status | Schema | Description |
|--------|--------|-------------|
| `200` | `ApiSuccess_dict_str__Any__` | Successful Response |
| `422` | `HTTPValidationError` | Validation Error |

**Response example (200):**

```json
{
  "data": {},
  "message": "",
  "status": "success",
  "warnings": [
    "string"
  ]
}
```

**cURL example:**

```bash
curl -X GET \
  -H "X-WHost-Key: $WHOST_API_KEY" \
  -H "X-WHost-Timestamp: $(date +%s)" \
  -H "X-WHost-Nonce: $(openssl rand -hex 16)" \
  -H "X-WHost-Signature: $(compute_hmac)" \
  https://your-server:2000/api/v1/client/dns/{domain}/dnssec
```

---

<a id="post-api-v1-client-dns-domain-dnssec-disable"></a>
#### `POST /api/v1/client/dns/{domain}/dnssec/disable`

*Disable DNSSEC (client)*

Disable DNSSEC for a domain owned by the authenticated client.

**Path parameters:**

| Name | Type | Required | Notes |
|------|------|----------|-------|
| `domain` | string | yes | — |

**Responses:**

| Status | Schema | Description |
|--------|--------|-------------|
| `200` | `ApiSuccess_dict_str__Any__` | Successful Response |
| `422` | `HTTPValidationError` | Validation Error |

**Response example (200):**

```json
{
  "data": {},
  "message": "",
  "status": "success",
  "warnings": [
    "string"
  ]
}
```

**cURL example:**

```bash
curl -X POST \
  -H "X-WHost-Key: $WHOST_API_KEY" \
  -H "X-WHost-Timestamp: $(date +%s)" \
  -H "X-WHost-Nonce: $(openssl rand -hex 16)" \
  -H "X-WHost-Signature: $(compute_hmac)" \
  https://your-server:2000/api/v1/client/dns/{domain}/dnssec/disable
```

---

<a id="post-api-v1-client-dns-domain-dnssec-enable"></a>
#### `POST /api/v1/client/dns/{domain}/dnssec/enable`

*Enable DNSSEC (client)*

Enable DNSSEC for a domain owned by the authenticated client.

**Path parameters:**

| Name | Type | Required | Notes |
|------|------|----------|-------|
| `domain` | string | yes | — |

**Responses:**

| Status | Schema | Description |
|--------|--------|-------------|
| `200` | `ApiSuccess_dict_str__Any__` | Successful Response |
| `422` | `HTTPValidationError` | Validation Error |

**Response example (200):**

```json
{
  "data": {},
  "message": "",
  "status": "success",
  "warnings": [
    "string"
  ]
}
```

**cURL example:**

```bash
curl -X POST \
  -H "X-WHost-Key: $WHOST_API_KEY" \
  -H "X-WHost-Timestamp: $(date +%s)" \
  -H "X-WHost-Nonce: $(openssl rand -hex 16)" \
  -H "X-WHost-Signature: $(compute_hmac)" \
  https://your-server:2000/api/v1/client/dns/{domain}/dnssec/enable
```

---

<a id="post-api-v1-client-dns-domain-records"></a>
#### `POST /api/v1/client/dns/{domain}/records`

*Add DNS record (client)*

Add a DNS record to a zone owned by the authenticated client.

**Path parameters:**

| Name | Type | Required | Notes |
|------|------|----------|-------|
| `domain` | string | yes | — |

**Body fields:**

| Field | Type | Required | Notes |
|-------|------|----------|-------|
| `content` | string | yes | — |
| `name` | string | yes | — |
| `port` | integer | no | — |
| `priority` | integer | no | — |
| `record_type` | DNSRecordType | yes | enum: `A`, `AAAA`, `CNAME`, `MX`, `TXT`, `NS`, `SRV`, `CAA`, `SOA`, `PTR` |
| `ttl` | integer | no | default `3600`; minimum=60.0; maximum=86400.0 |
| `weight` | integer | no | — |

**Request body example:**

```json
{
  "content": "string",
  "name": "string",
  "port": 0,
  "priority": 0,
  "record_type": "A",
  "ttl": 3600,
  "weight": 0
}
```

**Responses:**

| Status | Schema | Description |
|--------|--------|-------------|
| `200` | `ApiSuccess_dict_str__Any__` | Successful Response |
| `422` | `HTTPValidationError` | Validation Error |

**Response example (200):**

```json
{
  "data": {},
  "message": "",
  "status": "success",
  "warnings": [
    "string"
  ]
}
```

**cURL example:**

```bash
curl -X POST \
  -H "X-WHost-Key: $WHOST_API_KEY" \
  -H "X-WHost-Timestamp: $(date +%s)" \
  -H "X-WHost-Nonce: $(openssl rand -hex 16)" \
  -H "X-WHost-Signature: $(compute_hmac)" \
  -H "Content-Type: application/json" \
  -d @body.json \
  https://your-server:2000/api/v1/client/dns/{domain}/records
```

---

<a id="delete-api-v1-client-dns-domain-records-record-id"></a>
#### `DELETE /api/v1/client/dns/{domain}/records/{record_id}`

*Delete DNS record (client)*

Delete a DNS record from a zone owned by the authenticated client.

**Path parameters:**

| Name | Type | Required | Notes |
|------|------|----------|-------|
| `domain` | string | yes | — |
| `record_id` | integer | yes | — |

**Responses:**

| Status | Schema | Description |
|--------|--------|-------------|
| `200` | `MessageResponse` | Successful Response |
| `422` | `HTTPValidationError` | Validation Error |

**Response example (200):**

```json
{
  "message": "string",
  "status": "success"
}
```

**cURL example:**

```bash
curl -X DELETE \
  -H "X-WHost-Key: $WHOST_API_KEY" \
  -H "X-WHost-Timestamp: $(date +%s)" \
  -H "X-WHost-Nonce: $(openssl rand -hex 16)" \
  -H "X-WHost-Signature: $(compute_hmac)" \
  https://your-server:2000/api/v1/client/dns/{domain}/records/{record_id}
```

---

<a id="put-api-v1-client-dns-domain-records-record-id"></a>
#### `PUT /api/v1/client/dns/{domain}/records/{record_id}`

*Update DNS record (client)*

Update an existing DNS record in a zone owned by the authenticated client.

**Path parameters:**

| Name | Type | Required | Notes |
|------|------|----------|-------|
| `domain` | string | yes | — |
| `record_id` | integer | yes | — |

**Body fields:**

| Field | Type | Required | Notes |
|-------|------|----------|-------|
| `content` | string | no | — |
| `port` | integer | no | — |
| `priority` | integer | no | — |
| `ttl` | integer | no | — |
| `weight` | integer | no | — |

**Request body example:**

```json
{
  "content": "string",
  "port": 0,
  "priority": 0,
  "ttl": 60.0,
  "weight": 0
}
```

**Responses:**

| Status | Schema | Description |
|--------|--------|-------------|
| `200` | `ApiSuccess_dict_str__Any__` | Successful Response |
| `422` | `HTTPValidationError` | Validation Error |

**Response example (200):**

```json
{
  "data": {},
  "message": "",
  "status": "success",
  "warnings": [
    "string"
  ]
}
```

**cURL example:**

```bash
curl -X PUT \
  -H "X-WHost-Key: $WHOST_API_KEY" \
  -H "X-WHost-Timestamp: $(date +%s)" \
  -H "X-WHost-Nonce: $(openssl rand -hex 16)" \
  -H "X-WHost-Signature: $(compute_hmac)" \
  -H "Content-Type: application/json" \
  -d @body.json \
  https://your-server:2000/api/v1/client/dns/{domain}/records/{record_id}
```

---

<a id="post-api-v1-client-dns-domain-zone"></a>
#### `POST /api/v1/client/dns/{domain}/zone`

*Bootstrap DNS zone (client)*

Create a DNS zone for a domain owned by the authenticated client. Idempotent — returns existing zone if already created.

**Path parameters:**

| Name | Type | Required | Notes |
|------|------|----------|-------|
| `domain` | string | yes | — |

**Responses:**

| Status | Schema | Description |
|--------|--------|-------------|
| `200` | `ApiSuccess_dict_str__Any__` | Successful Response |
| `422` | `HTTPValidationError` | Validation Error |

**Response example (200):**

```json
{
  "data": {},
  "message": "",
  "status": "success",
  "warnings": [
    "string"
  ]
}
```

**cURL example:**

```bash
curl -X POST \
  -H "X-WHost-Key: $WHOST_API_KEY" \
  -H "X-WHost-Timestamp: $(date +%s)" \
  -H "X-WHost-Nonce: $(openssl rand -hex 16)" \
  -H "X-WHost-Signature: $(compute_hmac)" \
  https://your-server:2000/api/v1/client/dns/{domain}/zone
```

---
