cloudflare-dns-manager
Skill1 starsChanged 6 months agoMITView on GitHub
Manage Cloudflare DNS zones, DNS records, and Cloudflare single redirect rules through the official API. Use when an agent needs to inspect Cloudflare zones, list DNS records, create or update SPF/DKIM/DMARC/MX/CNAME/TXT records, delete records, configure www-to-apex redirects, export zones, or prepare DNS changes for domains hosted on Cloudflare, especially when the account contains multiple zones.
- Reads credentials
In this repository4 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agent-context-filesSkill
- gitlab-mrSkill
- git-workflowSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 9 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Use the bundled script to manage Cloudflare DNS through the official API.
- Very specific: line 17
Prefer explicit zone selection.
- Distinctive: line 21
Read references/auth-and-safety.md before the first write operation.
- Distinctive: line 23
Prefer API tokens over legacy global API keys.
- Distinctive: line 40
If the user only gives a hostname and the target zone is unclear, inspect candidates:
- Distinctive: line 59
Create or update a single record:
- Distinctive: line 94
Read references/records-json.md for the JSON schema.
- Very specific: line 112
Create or update a www -> apex redirect:
- Very specific: line 130
Delete a redirect rule by ref, id, or source host:
- Distinctive: line 146
Use redirect rules for canonical host routing.
- Very specific: line 150
Use DNS only for mail-related records.
- Very specific: line 154
Use --dry-run before apply-file on production zones.
- Distinctive: line 155
Stop and ask for confirmation before deleting records or redirects unless the user already explicitly requested the exact deletion.
- Distinctive: line 156
Keep comments and commit messages in English when editing this skill or its scripts.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Cloudflare DNS Manager
Use the bundled script to manage Cloudflare DNS through the official API.
Prefer explicit zone selection. When multiple domains exist in the same Cloudflare account, require --zone-name or --zone-id before any write operation. Do not guess the target zone for upsert-record, delete-record, apply-file, or upsert-redirect.
Authentication
Read references/auth-and-safety.md before the first write operation.
Prefer API tokens over legacy global API keys.
Supported environment variables:
CLOUDFLARE_API_TOKENCLOUDFLARE_EMAIL+CLOUDFLARE_API_KEY
Workflow
1. Identify the zone
List available zones first:
python3 scripts/cloudflare_dns.py list-zonesIf the user only gives a hostname and the target zone is unclear, inspect candidates:
python3 scripts/cloudflare_dns.py resolve-zone --fqdn send.example.comFor multi-zone accounts, stop and require an explicit --zone-name or --zone-id before editing.
2. Inspect existing records
List records in a zone before changing anything:
python3 scripts/cloudflare_dns.py list-records --zone-name example.com
python3 scripts/cloudflare_dns.py list-records --zone-name example.com --type TXT --name _dmarc3. Apply the change
Create or update a single record:
python3 scripts/cloudflare_dns.py upsert-record \
--zone-name example.com \
--type TXT \
--name _dmarc \
--content 'v=DMARC1; p=none'SMTP-related examples:
python3 scripts/cloudflare_dns.py upsert-record \
--zone-name example.com \
--type MX \
--name send \
--content feedback-smtp.us-east-1.amazonses.com \
--priority 10
python3 scripts/cloudflare_dns.py upsert-record \
--zone-name example.com \
--type CNAME \
--name em123._domainkey \
--content em123.example.sendprovider.net \
--proxied falseBatch apply from JSON:
python3 scripts/cloudflare_dns.py apply-file --zone-name example.com --file records.json --dry-run
python3 scripts/cloudflare_dns.py apply-file --zone-name example.com --file records.jsonRead references/records-json.md for the JSON schema.
4. Verify the result
Re-list the affected records after any change:
python3 scripts/cloudflare_dns.py list-records --zone-name example.com --name send5. Configure host redirects
List existing redirect rules:
python3 scripts/cloudflare_dns.py list-redirects --zone-name example.comCreate or update a www -> apex redirect:
python3 scripts/cloudflare_dns.py upsert-record \
--zone-name example.com \
--type CNAME \
--name www \
--content example.com \
--proxied true
python3 scripts/cloudflare_dns.py upsert-redirect \
--zone-name example.com \
--source-host www \
--target-host @ \
--status-code 301 \
--preserve-query-string trueDelete a redirect rule by ref, id, or source host:
python3 scripts/cloudflare_dns.py delete-redirect \
--zone-name example.com \
--source-host www \
--yesExport one zone for backup or migration:
python3 scripts/cloudflare_dns.py export-zone --zone-name example.com
python3 scripts/cloudflare_dns.py export-zone --zone-name example.com --file zone-export.jsonUse redirect rules for canonical host routing. DNS alone cannot issue HTTP 301 or 302 responses.
Guardrails
- Use
DNS onlyfor mail-related records. Do not proxy SMTP-relatedCNAMErecords. - For
MXrecords, pass--priority. - For redirect rules, ensure the source hostname is proxied and the token has redirect-rule edit permission.
- For deletion, prefer
--id. If deleting by--nameand--type, include--contentwhen duplicates may exist. - Use
--dry-runbeforeapply-fileon production zones. - Stop and ask for confirmation before deleting records or redirects unless the user already explicitly requested the exact deletion.
- Keep comments and commit messages in English when editing this skill or its scripts.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

