Cuando tienes la necesidad de actualizar tu IP de manera automática puedes usar el siguiente Scrip el cual actualiza la zona en cloudflare, para ello solo debes de cambiar el correo y la zona que quieres actualizar, para poder utilizarlo debes de tener instalado jq,

este scrip ha sido obtenido de


# A bash script to update a Cloudflare DNS A record with the external IP of the source machine
# Used to provide DDNS service for my home
# Needs the DNS record pre-creating on Cloudflare

# Proxy - uncomment and provide details if using a proxy
#export https_proxy=http://<proxyuser>:<proxypassword>@<proxyip>:<proxyport>

# Cloudflare zone is the zone which holds the record
# dnsrecord is the A record which will be updated

## Cloudflare authentication details
## keep these private
[email protected]

# Get the current external IP address
ip=$(curl -s -X GET

echo "Current IP is $ip"

if host $dnsrecord | grep "has address" | grep "$ip"; then
  echo "$dnsrecord is currently set to $ip; no changes needed"

# if here, the dns record needs updating

# get the zone id for the requested zone
zoneid=$(curl -s -X GET "$zone&status=active" \
  -H "X-Auth-Email: $cloudflare_auth_email" \
  -H "X-Auth-Key: $cloudflare_auth_key" \
  -H "Content-Type: application/json" | jq -r '{"result"}[] | .[0] | .id')

echo "Zoneid for $zone is $zoneid"

# get the dns record id
dnsrecordid=$(curl -s -X GET "$zoneid/dns_records?type=A&name=$dnsrecord" \
  -H "X-Auth-Email: $cloudflare_auth_email" \
  -H "X-Auth-Key: $cloudflare_auth_key" \
  -H "Content-Type: application/json" | jq -r '{"result"}[] | .[0] | .id')

echo "DNSrecordid for $dnsrecord is $dnsrecordid"

# update the record
curl -s -X PUT "$zoneid/dns_records/$dnsrecordid" \
  -H "X-Auth-Email: $cloudflare_auth_email" \
  -H "X-Auth-Key: $cloudflare_auth_key" \
  -H "Content-Type: application/json" \
  --data "{\"type\":\"A\",\"name\":\"$dnsrecord\",\"content\":\"$ip\",\"ttl\":1,\"proxied\":false}" | jq