Hourly
Get 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.
- Runs
- Hourly
- Apps
- Cloudflare
- AI
- Not needed
- Access
- DNS: Read
Send this to your assistant
Create a ClickRuntime automation: every hour, check the DNS records in my Cloudflare zones and post to #ops in Slack any record that was added, deleted or edited since the last check, with the old and new values.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A DNS change is quiet and dangerous. An administrator edits a record to test something and forgets to revert it, a vendor is given access and changes a CNAME, or an attacker with stolen credentials points a subdomain somewhere else. Cloudflare's audit log can show it, but only if someone knows to look.
Every hour, this lists your DNS records, compares them with the snapshot saved on the previous run, and posts a message showing exactly which records were added, removed or edited. It then saves the new state as the baseline for the next check.
Security-minded teams and agencies who share Cloudflare access among several people use it as a tripwire. The comparison uses a snapshot saved on the previous run, so the message shows what is different now, not a full list of every record to read through.
What you get out of it
Detect hijacked or tampered records
A subdomain suddenly pointing at an unfamiliar IP is how takeovers start. An hourly diff limits the exposure window to minutes rather than however long it takes someone to spot it. An unfamiliar IP on a subdomain is how takeovers begin, and an hourly diff keeps the window of exposure down to minutes.
Catch honest mistakes quickly
Most changes are accidental, such as a wrong value pasted in. Seeing the diff within the hour lets the person fix it before email bounces or a site goes down. Most DNS mistakes are honest ones, such as a pasted value that is slightly wrong, and a quick fix avoids bounced mail and downtime.
Know who to ask about a change
The post shows what changed and when, giving you something specific to bring to a teammate. That ends the mystery of an edit that nobody admits to. A dated message showing exactly which record changed gives you something specific to ask a teammate, and ends the mystery of an unexplained edit.
Create evidence for compliance
A running log of every record change supports change-management reviews. You can show when a record changed and that it was noticed promptly. A running log of record changes supports change-management reviews, and shows that changes were noticed soon after they were made.
Reduce the damage of shared access
When several people or vendors have Cloudflare access, a diff alert is cheap oversight. It does not block anyone, but it does make changes visible to everyone. With several people or vendors holding access, a diff alert makes changes visible to everyone and does not get in anyone's way.
How it works
What happens, step by step
Every hour ClickRuntime reads all the DNS records in your Cloudflare domains.
It compares them with the copy it saved last hour.
Any record that was added, removed or edited goes to your Slack channel, showing the old and new values.
The new copy is saved for the next check.
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, state
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):
snapshot = {}
for zone in cf("/zones", per_page=50):
for r in cf(f"/zones/{zone['id']}/dns_records", per_page=5000):
snapshot[r["id"]] = f"{r['type']} {r['name']} -> {r['content']}"
old = state.get("records")
changes = []
if old is not None:
changes += [f"Added: {v}" for k, v in snapshot.items() if k not in old]
changes += [f"Deleted: {v}" for k, v in old.items() if k not in snapshot]
changes += [f"Edited: {old[k]} => {v}" for k, v in snapshot.items() if k in old and old[k] != v]
if changes:
notify.slack("DNS changes\n" + "\n".join(changes), channel="#ops")
state.set("records", snapshot)
return {"changes": len(changes)}FAQ
Common questions
What does the diff message show?
Will it alert on the first run?
Can it watch only certain record types?
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 worksEmail yourself a weekly DNS backup
Each week a copy of every DNS record in your zones lands in your inbox, ready to restore from.
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 “Get a Slack alert when a DNS record changes” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.