Skip to content

Instantly share code, notes, and snippets.

@ndunks
Created December 17, 2018 14:23
Show Gist options
  • Save ndunks/59c10c3006d4bb036fd23a3fb0ff1a4e to your computer and use it in GitHub Desktop.
Save ndunks/59c10c3006d4bb036fd23a3fb0ff1a4e to your computer and use it in GitHub Desktop.
Cloudflare Update DNS IP with bash
#!/bin/bash
ip=$(curl -s https://api.ipify.org/)
echo "DDNS-UPDATE: Public IP is: $ip, Updating IP..."
host=home.klampok.id
curl -X PUT "https://api.cloudflare.com/client/v4/zones/00000000000000000000/dns_records/00000000000000000000000" \
-H "X-Auth-Email: *******@gmail.com" \
-H "X-Auth-Key: *******" \
-H "Content-Type: application/json" \
--data '{"type":"A","name":"home.klampok.id","content":"'"$ip"'","ttl":120,"proxied":false}' )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment