1. 基本信息
| 接口地址 | https://v1.apizero.cn/api/cf-dns |
|---|
| 请求方法 | POST |
|---|
| 分类 | dev |
|---|
| 提供方 | 极数本源 |
|---|
| 计费模式 | 免费试用 |
|---|
| 单次消耗 | 0 积分 |
|---|
| 起步价 | — |
|---|
| QPS 限制 | 5 req/s |
|---|
| 每日免费额度 | 50 次(已认证用户) |
|---|
| 匿名每日额度 | 0 次(无 API Key) |
|---|
| VIP 免费 | 否 |
|---|
| 调用次数 | |
|---|
3. 请求参数
| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|
domain | string | 是 | 根域名 | example.com |
host | string | 是 | 主机记录 @ / www | home |
ip | string | 是 | 要设置的 IP | — |
token | string | 是 | Cloudflare API Token | — |
type | string | 否 | A / AAAA(默认 A) | — |
ttl | number | 否 | TTL 120-86400(默认 120) | — |
proxied | bool | 否 | 是否启用 CDN 代理(默认 false) | — |
5. 请求示例 (cURL)
curl -X POST "https://v1.apizero.cn/api/cf-dns" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"domain": "example.com",
"host": "home",
"ip": "<ip>",
"token": "<token>",
"type": "<type>",
"ttl": "<ttl>",
"proxied": "<proxied>"
}'
6. 响应字段
| 字段 | 类型 | 说明 | 示例 |
|---|
old_ip | string | 更新前的 IP | — |
new_ip | string | 更新后的 IP | — |
changed | bool | 是否实际有变化 | — |
zone_id | string | Cloudflare Zone ID | — |
record_id | string | Cloudflare Record ID | — |
7. 响应示例
{
"code": 0,
"msg": "成功",
"data": {
"message": "DNS 记录更新成功",
"full_name": "home.example.com",
"type": "A",
"old_ip": "1.2.3.4",
"new_ip": "5.6.7.8",
"changed": true
}
}
8. 错误码
| code | status | 说明 |
|---|
4000 | — | 参数缺失或格式错误(IP 类型与 type 不匹配等) |
5020 | — | Cloudflare 接口失败(Token 无效 / Zone 未找到 / 记录不存在) |
9. 变更日志
- 1.0.0(2026-05-07)
- 首次上线 · IPv4/IPv6 + 代理状态控制