Skip to content

Instantly share code, notes, and snippets.

@maygoo
maygoo / cloudflare-ddns.sh
Last active January 1, 2024 04:58 — forked from Firsh/lwp-cloudflare-dyndns.sh
Cloudflare Dynamic DNS script
#!/bin/bash
# Cloudflare as Dynamic DNS
# Forked from: https://gist.github.com/Firsh/c9f72970eaae3aec04beb1106cc304bc
# Edited to: * use api token instead of global api key (more secure)
# * remove duplicate requirement of zone & record names
# * automatically create DNS record if one does not exist
# Update these with real values
# api token needs "DNS.Edit" permissions for the zone you want to update
api_token="API_TOKEN"