---
title: "Add a DNS record"
method: POST
path: "/agent/dns/zones/{id}/records"
tags: ["DNS"]
---

# Add a DNS record

`POST /agent/dns/zones/{id}/records`

## Request

- Base URL: `https://edge.network`
- URL: `https://edge.network/agent/dns/zones/{id}/records`
- Auth: HTTP bearer

Add a record to a zone. MX records require priority.

## Path parameters

- `id` string, required

## Headers

- `X-Dry-Run` 'true' | 'false'
- `Idempotency-Key` string

## Request body

- object
  - `type` 'A' | 'AAAA' | 'CNAME' | 'MX' | 'TXT' | 'NS', required
  - `name` string, required: "www", "@" for root, etc.
  - `data` string, required: IP address, hostname, or text value.
  - `ttl` number
  - `priority` number: Required for MX records.

## Response `201`

Success.

- object
  - `record` DnsRecord, required
    - `id` string
    - `type` 'A' | 'AAAA' | 'CNAME' | 'MX' | 'TXT' | 'NS', required
    - `name` string, required: Record name, e.g. "www" or "@" for the zone root.
    - `data` string, required: Record value, e.g. an IP address or target hostname.
    - `ttl` number
    - `priority` number, nullable: MX priority.
  - `tell_user` string: Human-readable summary of what happened, for the agent to relay to its operator.

## Other responses

- `400`: Validation error — the response body explains what to fix.
- `401`: Missing or invalid agent access code. The body includes self-signup pointers.
- `429`: Rate limited. Honour Retry-After and the RateLimit-* headers before retrying.

---

[API](https://skmtc.dev/edge/apis/edge-network-agent-api.md) · [All operations](https://skmtc.dev/edge/apis/edge-network-agent-api/llms.txt) · [OpenAPI document](https://skmtc.dev/edge/apis/edge-network-agent-api/revisions/49b5f2adf020?raw)
