xieyuanqing

Cloudflare Dns Updater

運維安全v0.1.1
作者:xieyuanqing更新於 2026-05-17共 2 個版本 · 最新版本釋出於 2026-02-06cloudflare-dns-updater@clawhub_xieyuanqing/cloudflare-dns-updater
伺服器運維

據 AlphaMoat 統計,截至 2026-09,Cloudflare Dns Updater 累計下載 2,856 次、獲 0 個星標,在全部 5,078 個 AI 技能中排名第 3,830 位,在「運維安全」分類(264 個)中排名第 244 位。

累計安裝
129
累計下載
2856
星標
-
全站排名
#3,830
全站前 76% · 「運維安全」前 93%
平台累計安裝累計下載星標評論
ClawHub ↗852697--
SkillHub ↗1292856-—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

該技能使用具有 DNS 編輯許可權的 API 令牌,將指定主機名指向給定 IP 並開啟代理。錯誤的區域、記錄名或目標地址可能導致流量被錯誤路由;應獨立確認區域、主機名和目標伺服器 IP,並將令牌許可權限制在所需區域。令牌不可寫入日誌或提示內容。

資料釋出於 2026-10-29

可以用來做什麼

  • 將子域名指向指定伺服器地址
  • 更新 Cloudflare 代理 DNS A 記錄
  • 在自動化部署中執行經稽核的 DNS 變更

什麼時候用

  • 使用者明確要求修改 Cloudflare DNS 時
  • 可獨立核對目標區域、記錄和伺服器 IP 時
  • API 令牌僅授予目標區域所需許可權時

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

先展示要修改的區域、記錄名、目標 IP 和代理設定;不要讀取或輸出令牌,也不要提交變更,直到我核對並確認。

月度資料趨勢

累計下載2856
1528224129542026-03 · 累計下載 16262026-05 · 累計下載 21072026-06 · 累計下載 22412026-07 · 累計下載 24322026-08 · 累計下載 26022026-09 · 累計下載 285626-0326-09
星標-
0112026-03 · 星標 -2026-05 · 星標 -2026-06 · 星標 -2026-07 · 星標 -2026-08 · 星標 -2026-09 · 星標 -26-0326-09

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。

月份累計下載環比星標
2026-092856—-
2026-082602+7.0%-
2026-072432+8.5%-
2026-062241+6.4%-
2026-052107—-
2026-031626—-

SKILL.md 原文

以下是作者釋出的原始檔案,按純文字顯示,本站未做修改或稽核;其中的連結不可點選,命令請核實後再執行。抓取於 2026-10-23。

3.5 KB · ClawHub v0.1.1
---
name: cloudflare-dns-updater
description: "Creates or updates a proxied Cloudflare DNS A record. Use when you need to programmatically point a subdomain to an IP address. Takes record name, zone name, and IP address as input."
metadata:
  openclaw:
    requires:
      bins: ["python3"]
      python: ["requests"]
---
展開全部(共 80 行)
# Cloudflare DNS Updater

This skill creates or updates a Cloudflare DNS 'A' record, pointing it to a specified IP address and ensuring it is proxied. It is a foundational tool for automating service deployment and DNS management.

## Pre-requisites

This skill requires the `CLOUDFLARE_API_TOKEN` environment variable to be set with a valid Cloudflare API Token that has DNS edit permissions.

The model should verify this prerequisite before attempting to use the skill. If the variable is not set, it should inform the user and stop.

## Core Action: `scripts/update-record.py`

The core logic is handled by the `update-record.py` script.

### **Inputs (Command-Line Arguments)**

- `--zone`: (Required) The root domain name. Example: `example.com`
- `--record`: (Required) The name of the record (subdomain). Use `@` for the root domain itself. Example: `www`
- `--ip`: (Required) The IPv4 address to point the record to.
- `--proxied`: (Optional) Boolean (`true` or `false`) to set the Cloudflare proxy status. Defaults to `true`.

### **Output**

The script will print its progress to stdout.
- On success, it prints a confirmation message and a JSON object of the created/updated record.
- On failure, it prints a descriptive error message to stderr and exits with a non-zero status code.

### **Execution Workflow**

To use this skill, follow these steps:

1.  **Verify Prerequisites**: Check if the `CLOUDFLARE_API_TOKEN` environment variable is set. If not, notify the user and abort.
2.  **Gather Inputs**: From the user's request, identify the `zone`, `record` name, and target `ip`.
3.  **Construct Command**: Build the full shell command to execute the script.
4.  **Execute Command**: Run the command using the `exec` tool.
5.  **Report Result**:
    - If the command succeeds, report the successful creation or update to the user.
    - If the command fails, analyze the error message from stderr and report the issue to the user in a clear, understandable way.

### **Example Usage**

**User Request:** "Point www.example.com to the server's public IP."

**AI's Thought Process:**
1.  The user wants to update a DNS record on Cloudflare. The `cloudflare-dns-updater` skill is perfect for this.
2.  I will use the `update-record.py` script.
3.  I need the zone, record name, and IP.
    - Zone: `example.com`
    - Record: `www`
    - IP: I need to find the server's public IP first. I can use `curl -s https://ipv4.icanhazip.com/`.
4.  I will first get the IP, then construct the final command.
5.  I will execute the command and report the outcome.

**AI's Actions:**
```bash
# Step 1: Get IP
PUBLIC_IP=$(curl -s https://ipv4.icanhazip.com/)

# Step 2: Run the skill's script
python3 skills/cloudflare-dns-updater/scripts/update-record.py \
  --zone "example.com" \
  --record "www" \
  --ip "$PUBLIC_IP"
```

### **Failure Strategy**

- **If `CLOUDFLARE_API_TOKEN` is not set:** Do not attempt to run the script. Inform the user that the required environment variable is missing and needs to be configured by the administrator.
- **If the script exits with an error:** Read the error message from stderr. Common errors include invalid API token, incorrect zone name, or insufficient permissions. Report the specific error to the user.

「運維安全」分類下的熱門技能

資料月份:2026-09 · 下載/星標/安裝數聚合自公開技能註冊庫(ClawHub、SkillHub),按月更新。口徑說明見資料方法。