Weekly
Email yourself a weekly DNS backup
Each week a copy of every DNS record in your zones lands in your inbox, ready to restore from.
- Runs
- Weekly
- Apps
- Cloudflare
- AI
- Not needed
- Access
- Zone: Read, DNS: Read
Send this to your assistant
Create a ClickRuntime automation: every Sunday at 6pm, export the DNS records for all my Cloudflare zones as BIND zone files and email them to me in the body of the message.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
DNS is the part of your infrastructure that fails in the most embarrassing way. Someone deletes the wrong record, a registrar migration drops MX entries, or an old teammate's script overwrites a zone, and suddenly email stops arriving. Recovering means remembering what the records used to be, and nobody keeps that in their head.
Every week, this lists your Cloudflare zones, exports the DNS records for each one, and emails you the files. Your inbox ends up with a dated series of zone exports you can restore from or compare against.
It is valuable for small teams without infrastructure-as-code for DNS, and for agencies that manage zones on behalf of clients. The export is produced by Cloudflare itself, so the files hold the records exactly as the zone had them at that moment, ready to import elsewhere if you ever need to.
What you get out of it
Recover fast from an accidental deletion
If an A record or an MX entry disappears, you can read the exact values from last week's export. Restoring takes minutes, compared with hours of reverse engineering. Reading the exact value from last week's file turns a stressful reconstruction into a quick restore that takes minutes, not hours.
Keep a copy outside Cloudflare
A backup in your own mailbox survives account lockouts, billing problems or a compromised login. DNS is critical enough to justify a copy held somewhere independent. Your own mailbox has a different set of risks to your Cloudflare account, so the copy protects you if the account is locked or compromised.
Support audits and client handovers
Agencies can hand a client a dated export of their zone when an engagement ends. Auditors and new IT hires can see what was configured at a given time. An agency can give a client a dated export of their zone when the engagement ends, and auditors can see what was in place on a date.
See what changed between weeks
Comparing two exports shows which records were added, removed or edited. That helps explain a sudden email deliverability problem or a new unexpected subdomain. Comparing two weekly exports shows what changed, which often explains a sudden deliverability problem or a mystery subdomain very quickly.
Reduce the risk of a migration
Before moving registrars or nameservers, you already hold a recent export of every record. That removes one of the most common causes of lost mail during migrations. Moving to another provider is far less risky when you already have a recent copy of every record sitting in your inbox.
How it works
What happens, step by step
Every week ClickRuntime lists the domains in your Cloudflare account.
It exports every DNS record for each one in the standard zone-file format.
The files arrive in your inbox, ready to import if you ever need to restore.
Before it runs live
- Connect Cloudflare
What you get
Build your own
Need it to work differently?
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
Changes you can ask for
- Run it at a different time, more or less often, or only on weekdays
- Add an AI step, for example to summarize, sort or draft a reply
- Add another app, for example also send it to Slack
- Combine it with other Cloudflare steps into one automation
Under the hood
The code that runs this automation
from clickruntime import on_trigger, credentials, http, notify
CF = "https://api.cloudflare.com/client/v4"
def cf(path, **params):
resp = http.get(f"{CF}{path}", params=params, headers={"Authorization": f"Bearer {credentials.secret('CLOUDFLARE_API_TOKEN')}"})
resp.raise_for_status()
return resp.json()["result"]
@on_trigger
def run(event):
token = credentials.secret("CLOUDFLARE_API_TOKEN")
parts = []
for zone in cf("/zones", per_page=50):
bind = http.get(f"{CF}/zones/{zone['id']}/dns_records/export", headers={"Authorization": f"Bearer {token}"})
bind.raise_for_status()
parts.append(f";; ===== {zone['name']} =====\n{bind.text}")
notify.email_me(f"Cloudflare DNS backup: {len(parts)} zones", "\n\n".join(parts))
return {"zones": len(parts)}FAQ
Common questions
Which format are the records exported in?
Does it back up every zone in my account?
What Cloudflare token permissions are needed?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Get a weekly Cloudflare traffic report
Every Monday you see requests, bandwidth and blocked threats for each site, with the change from the week before.
See how it worksGet a Slack alert when a DNS record changes
Within the hour you know about any DNS record that was added, removed or edited, and what it looked like before.
See how it worksGet warned 30 days before a certificate expires
Each certificate close to expiry is flagged once, a month ahead, so you have time to renew it.
See how it worksKeep exploring
Set up “Email yourself a weekly DNS backup” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.