Skip to content

Instantly share code, notes, and snippets.

@jyungtong
Created September 28, 2017 05:11
Show Gist options
  • Save jyungtong/7a01fdcec07c3e4c16679b4c82013150 to your computer and use it in GitHub Desktop.
Save jyungtong/7a01fdcec07c3e4c16679b4c82013150 to your computer and use it in GitHub Desktop.
Update Cloudflare IP
#!/bin/bash
curl -XPUT \
-H'X-AUTH-EMAIL: [email protected]' \
-H'X-AUTH-KEY: YOUR_VERY_SECRET_AUTH_KEY' \
-H'content-type: application/json' \
"https://api.cloudflare.com/client/v4/zones/{ZONE_ID}/dns_records/{DNS_RECORD}" \
--data '{"type":"A", "name":"YOUR.DOMAIN.COM", "content": "'"$(curl ipinfo.io/ip)"'", "ttl": 120, "proxied": false}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment