ASUSWRT-MERLIN custom DDNS Script for Cloudflare
for Cloudflare as DDNS
using Cloudflare API v4
Using
put ddns-start
at /jffs/scripts/
, setting values and set DDNS type to Custom at web Admin panel.
setting
EMAIL
is your Cloudflare account
API
is your Cloudflare API Key. You can find at My Setting
-> API Key
-> Global API Key
-> View API Key
ZONEID
can find by following command
curl -X GET "https://api.cloudflare.com/client/v4/zones" \\
-H "X-Auth-Email: $EMAIL" \\
-H "X-Auth-Key: $API" \\
-H "Content-Type: application/json"
RECORDID
can find by following command
curl -X GET "https://api.cloudflare.com/client/v4/zones/${ZONE}/dns_records?page=1&per_page=1000&order=type&direction=asc" \\
-H "Content-Type:application/json" \\
-H "X-Auth-Key: $API" \\
-H "X-Auth-Email: $EMAIL"
RECORDNAME
is target domain name like ddns.dd-han.tw
RECORDTTL
is record TTL in minute (1=auto)
if you don't want skip SSL check, run opkg install ca-certificates
and change command from curl -ks
to curl -s