Skip to content

Instantly share code, notes, and snippets.

@geoffmyers
Last active October 8, 2017 02:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geoffmyers/84640a983555ddc8318d4f6c597a9cd1 to your computer and use it in GitHub Desktop.
Save geoffmyers/84640a983555ddc8318d4f6c597a9cd1 to your computer and use it in GitHub Desktop.
Cloudflare Dynamic DNS Simple Update Script
#!/usr/local/bin/zsh
IP_ADDRESS=$(curl ipecho.net/plain ; echo)
curl -X PUT "https://api.cloudflare.com/client/v4/zones/{zone_identifier}/dns_records/{identifier}" \
-H "X-Auth-Email: {cloudflare_email_address}" \
-H "X-Auth-Key: {cloudflare_api_key}" \
-H "Content-Type: application/json" \
--data "{\"type\":\"A\",\"name\":\"{domain_name}\",\"content\":\"$IP_ADDRESS\"}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment