← 返回
开发者工具 Key 中文

Cloudflare Dns

Manage Cloudflare DNS records via API. Use when user asks to list, create, update, or delete DNS records, set up DDNS, manage domains on Cloudflare, or check DNS propagation. Supports A, AAAA, CNAME, TXT, MX, and other record types.
通过 API 管理 Cloudflare DNS 记录。适用于列出、创建、更新或删除记录,配置 DDNS,管理域名及检查 DNS 生效。支持 A、AAAA、CNAME、TXT、MX 等类型。
pushp1997
开发者工具 clawhub v1.0.0 1 版本 99735.6 Key: 需要
★ 0
Stars
📥 1,509
下载
💾 8
安装
1
版本
#latest

概述

Cloudflare DNS

Manage DNS records via Cloudflare API using the bundled cf-dns.sh script.

Setup

Store credentials in environment or pass via flags:

export CF_API_TOKEN="your-api-token"
export CF_ZONE_ID="your-zone-id"       # optional, can auto-detect from domain

Get API token: Cloudflare Dashboard → My Profile → API Tokens → Create Token → "Edit zone DNS" template.

Get Zone ID: Cloudflare Dashboard → select domain → Overview → right sidebar "Zone ID".

Usage

The script is at scripts/cf-dns.sh. All commands:

# List zones (find zone ID)
cf-dns.sh zones

# List all records for a zone
cf-dns.sh list <zone_id>
cf-dns.sh list --domain example.com

# Get specific record
cf-dns.sh get <zone_id> <record_id>

# Create record
cf-dns.sh create <zone_id> --type A --name www --content 1.2.3.4 [--ttl 300] [--proxied]
cf-dns.sh create <zone_id> --type CNAME --name blog --content example.com
cf-dns.sh create <zone_id> --type TXT --name @ --content "v=spf1 ..."
cf-dns.sh create <zone_id> --type MX --name @ --content mail.example.com --priority 10

# Update record
cf-dns.sh update <zone_id> <record_id> --content 5.6.7.8 [--ttl 600] [--proxied]

# Delete record
cf-dns.sh delete <zone_id> <record_id>

# DDNS: update A record to current public IP
cf-dns.sh ddns <zone_id> --name home
cf-dns.sh ddns --domain example.com --name home

Common Patterns

Add subdomain pointing to IP:

cf-dns.sh create <zone_id> --type A --name subdomain --content 203.0.113.50 --proxied

Set up email (MX + SPF):

cf-dns.sh create <zone_id> --type MX --name @ --content mail.example.com --priority 10
cf-dns.sh create <zone_id> --type TXT --name @ --content "v=spf1 include:_spf.google.com ~all"

Dynamic DNS for home server:

# Run periodically via cron
cf-dns.sh ddns --domain example.com --name home

Notes

  • --proxied enables Cloudflare proxy (orange cloud) — hides origin IP, adds CDN
  • TTL in seconds; use 1 for "Auto" when proxied
  • @ means root domain
  • Script outputs JSON; pipe to jq for parsing

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-29 00:19 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

communication-collaboration

Ovh

pushp1997
通过API管理OVHcloud服务。用于用户询问OVH域名、DNS记录、VPS、云实例、专用服务器、邮箱、SSL证书或任何OVH服务管理时。支持资源的查询、创建、更新和删除操作。
★ 0 📥 1,362
developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 67 📥 180,066
developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 921 📥 185,777