This is a Bash script to update a Netlify subdomain A record with the current external IP.
I also created a Gist for this script for a blog post.
netlify-ddns.sh <ACCESS_TOKEN> <DOMAIN> <SUBDOMAIN> <TTL> [<CACHED_IP_FILE>]
The example below would update the local.example.com A record to the current external IP with a TTL of 5 minutes.
The last parameter for the script is optional and is used to cache the Netlify IP to reduce API calls.
netlify-ddns.sh aCcEsStOKeN example.com local 300 /home/johnsmith/cached-ip-file.txt
- Bash
- jq
- lukehsiao/netlify-ddns-rs for a similar client written in Rust.
- oscartbeaumont/netlify-dynamic-dns for a similar client written in Go.
- lytedev/netlify-ddns for another similar shell script version.