Trying to update DDNS with a bash script using Api v4


#1

I followed this guide: https://www.rohanjain.in/cloudflare-ddns/

I had to create two scripts to update both my @ and www records.

They work but when they update my ip address with cloudflare; it turns the little orange cloud to gray and I have to turn it back on.

Is there a script out there that can update both my A records with my current Dynamic IP without changing the orange cloud?


#2

What value are you setting proxied to wen updating the record?

https://api.cloudflare.com/#dns-records-for-a-zone-update-dns-record

curl -X PUT "https://api.cloudflare.com/client/v4/zones/023e105f4ecef8ad9ca31a8372d0c353/dns_records/372e67954025e0ba6aaa6d586b9e0b59" \
     -H "X-Auth-Email: [email protected]" \
     -H "X-Auth-Key: c2547eb745079dac9320b638f5e225cf483cc5cfdda41" \
     -H "Content-Type: application/json" \
     --data '{"type":"A","name":"example.com","content":"192.0.2.1","proxied":true}'

#3

Following that guide the --data points to a cloudflare-ddns-update.json file.

In that file the proxied is set to false.

How can I change this?


#4

Just edit the file and change the value to true.