This was a project designed to explore the Cloudflare API through their official Go Client.
This application updates a given domain name to the current machine's ip address with the use of the https://ipify.org service. Alternative ip address services may be used if it returns the ip address of the current machine in plain text by overriding the configuration option.
You can run this service in a cron job or a systemd timer, or once, up to you!
Install via with the Go toolchain to compile from source:
go get github.com/wyattjoh/cloudflare-ddns
Download pre-compiled binary on the Releases Page for your Arch/OS.
brew install wyattjoh/stable/cloudflare-ddns
Configuration is specified in the environment or as command line arguments.
--token
orENV['CF_API_TOKEN']
(required if--key
and--email
not provided) - The API Token that has the Zone.DNS permission for the specific zone.--key
orENV['CF_API_KEY']
(required if--token
not provided) - specify the Global (not CA) Cloudflare API Key generated on the "My Account" page.--email
orENV['CF_API_EMAIL']
(required if--token
not provided) - Email address associated with your Cloudflare account.--domain
orENV['CF_DOMAIN']
(required) - Comma separated domain names that should be updated. (i.e. mypage.example.com OR example.com)--ipendpoint
orENV['CF_IP_ENDPOINT']
(optional, default:https://api.ipify.org
) - Alternative ip address service endpoint.
Note: One of --key
and --email
or --token
must be defined