natmap icon indicating copy to clipboard operation
natmap copied to clipboard

ddns via cloudflare

Open linnuxx opened this issue 10 months ago • 2 comments

#!/bin/sh

ZONE='' RECORD='' EMAIL='' AUTH='' DOMAIN=''

IP4P=${3}

while true; do curl -X PUT "https://api.cloudflare.com/client/v4/zones/${ZONE}/dns_records/${RECORD}"
-H "X-Auth-Email: ${EMAIL}"
-H "Authorization: Bearer ${AUTH}"
-H "Content-Type:application/json"
--data "{"type":"AAAA","name":"${DOMAIN}","content":"${IP4P}","ttl":60,"proxied":false}" > /dev/null 2> /dev/null if [ $? -eq 0 ]; then break fi done

where to get these variables: ZONE=" RECORD=" EMAIL=" AUTH=" DOMAIN="

linnuxx avatar Apr 18 '24 00:04 linnuxx

refer to https://developers.cloudflare.com/api/

heiher avatar Apr 20 '24 10:04 heiher