Skip to content

Instantly share code, notes, and snippets.

@rohityadavcloud
Created January 9, 2016 12:05
Show Gist options
  • Save rohityadavcloud/1137284150b9160e3910 to your computer and use it in GitHub Desktop.
Save rohityadavcloud/1137284150b9160e3910 to your computer and use it in GitHub Desktop.
CloudFlare DDNS
cfuser=you@email.com
cfkey=cf-key-here
zoneid=some-zoneid
dnsrec=dns-record-id
domain=somedomain.com
curl -X PUT "https://api.cloudflare.com/client/v4/zones/$zoneid/dns_records/$dnsrec" \
-H "X-Auth-Email: $cfuser" \
-H "X-Auth-Key: $cfkey" \
-H "Content-Type: application/json" \
--data '{"id":"'$dnsrec'","type":"A","name":"'$domain'","content":"'`curl -s http://icanhazip.com`'"}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment