Skip to content

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.

Paste it into your assistant. It tells you what it will send or change before it runs live.

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

  1. Every week ClickRuntime lists the domains in your Cloudflare account.

  2. It exports every DNS record for each one in the standard zone-file format.

  3. The files arrive in your inbox, ready to import if you ever need to restore.

Before it runs live

  • Connect Cloudflare

What you get

RunsWeekly
Email yourself a weekly DNS backuptoday, 9:00Succeeded
Email · DNS backup;; ===== example.com ===== example.com. 1 IN A 192.0.2.10

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • 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

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
email_a_backup_of_dns_records.pyexample
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?
Cloudflare's export produces a standard zone file for each zone, which you can import into most DNS providers. The files arrive as attachments, one per zone. Cloudflare produces a standard zone file for each zone, which most DNS providers can import, and one file is attached per zone.
Does it back up every zone in my account?
It lists the zones the API token can see and exports each of them. If you only want certain domains, tell your AI assistant to limit the list and approve the revised flow. Selecting certain zones is a small change, and the shorter list is shown to you for approval before the next weekly email.
What Cloudflare token permissions are needed?
A token with read access to DNS for the zones you want is enough. It cannot edit records because the automation only reads and exports them, and the token is stored as a secret. A token that can read DNS for your zones is enough, and it is kept as a secret, so the automation can never edit any records.
What permissions does it need?
Zone: Read, DNS: Read. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run each time it runs (weekly). Checks that find nothing to do and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

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.