身份验证
请将 API 密钥作为 bearer 令牌发送。该密钥必须具有 domains.dns.manage 权限;缺少该权限的密钥将被拒绝并返回 403 状态码,而非 404。
此端点不需要组织 ID。您的密钥已用于识别其所属的组织,且响应范围也仅限于该组织。
免费试用
将尖括号中的内容替换为您自己的值,并将键占位符替换为您仪表板中的一个键。
curl -X POST https://api.zinndigital.com/v1/domains/{domainId}/dns/records \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "name": <string>, "type": <DnsRecordType>, "value": <string> }'已登录?您仪表板中的 API 控制台会自动填入您真实的组织 ID 和您自己的密钥,并针对实时 API 运行请求,以便您查看实际的响应。 在 API 控制台中打开此端点
详细信息
Adds a record to the domain's hosted zone. Requires `domains.dns.manage`. On the Footprint-Free line an A/AAAA record (or a `CNAME` to an IP literal, which resolves to one) is refused with a 422 — those are platform-managed. **Adding an apex `MX` is not additive** (issue #622). MX preference is lowest-number-wins, so a new record at or below the best existing preference takes delivery away from the host the customer's mail reaches today, without removing its record. That is refused `409 MAIL_CHANGE_REFUSED` unless `confirm_mail_change=true`; a strictly higher preference number is an ordinary backup MX and is allowed, as is the first `MX` on a domain that has none.
参数
| 名称 | 类型 | 必填 | 内容简介 |
|---|---|---|---|
domainId (path) | Uuid | 是 | The domain's id. |
confirm_mail_change (query) | boolean | 否 | Set `true` to proceed with a record change that would move or remove this domain's inbound email (issue #622). Without it, a write that stops mail reaching a host it reaches tod… |
请求正文
| 名称 | 类型 | 必填 | 内容简介 |
|---|---|---|---|
name | string | 是 | The record name — `@`/empty for the apex, or a relative/absolute host. |
type | DnsRecordType | 是 | A DNS resource-record type the shared editor supports (docs/31 §5.2). |
value | string | 是 | — |
ttl | integer | 否 | — |
priority | object | 否 | — |
proxied | object | 否 | Serve this record through the provider's HTTP proxy — Cloudflare's orange cloud. **`A` and `AAAA` only**; sending it on any other type is a `422` rather than a silent drop, beca… |
响应
| 名称 | 类型 | 必填 | 内容简介 |
|---|---|---|---|
id | string | 是 | The provider-assigned record id. |
name | string | 是 | The record name — `@` for the apex, or a relative/absolute host. |
type | DnsRecordType | 是 | A DNS resource-record type the shared editor supports (docs/31 §5.2). |
value | string | 是 | The record value (target/content). |
ttl | integer | 是 | Time-to-live in seconds. |
priority | object | 否 | Priority for MX/SRV records; null otherwise. |
proxied | object | 否 | Whether this record is served through the provider's HTTP proxy — Cloudflare's **orange cloud**. Applies to `A` and `AAAA`; providers without a proxy ignore it. ⛔⛔ **Three state… |
owner | DnsRecordOwner | 是 | Who may change this record. `platform` means the platform created it and converges it — the A/AAAA record at the apex or `www` that points the domain at the hosting we run for i… |
drift | DnsRecordDrift | 否 | What the last reconcile found about a **platform-owned** record at the provider, or `null` when the provider agrees with us (the overwhelmingly common case). `changed` — a recor… |
此端点可能返回的错误
401 · 403 · 404 · 409 · 422 · 429 · 502 · 503