Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

I want to have a script run automatically on my Mac at home, once an hour, to update the A record of a domain name which lives on DigitalOcean’s name servers.
I want the A record to be updated with whatever my external home IP address is (in effect, a dynamic DNS service so I can always get back to my home computer over the internet). My home computer sits behind a router supplied by my ISP.
I have been looking at the DigitalOcean API (v2) and using Terminal on my Mac I can successfully, manually, update the A record in question with the following command:
curl -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer MY_API_ACCESS_TOKEN" -d '{"data":"IP_ADDRESS"}' "https://api.digitalocean.com/v2/domains/MY_DOMAIN/records/DOMAIN_ID_NUMBER"
What I’d like some help with, please, is how do I add to the above so that:
I’m quite new to all this so I’m sorry if I’m missing anything obvious.
Thanks, any help appreciated.
Erina Jones
05c643336f3a4578a0b414e11ed8fc
792d8c6065294b4da466a26b2a99e4
Joseph Roberts
KFSys
abdullah527382
Karan M Janthe
Brendo Ross
wendoj
d40d179698b0e4b36f241171147902
ff6af0b019c84c9788ebcc3077