analogist / cloudflare-ddns

Zero dependency dynamic DNS 🐳

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dynamic DNS

Updates a given a DNS record with your current IP

Example with the Cloudflare provider:

docker run \
  -e PROVIDER=cloudflare \
  -e CLOUDFLARE_APIKEY=YOUR_API_KEY \
  -e CLOUDFLARE_ZONE=YOUR_ZONE \
  -e CLOUDFLARE_HOST=YOUR_DOMAIN \
  -e CLOUDFLARE_EMAIL=YOUR_CLOUDFLARE_EMAIL \
  hugomd/cloudflare-ddns

Example running as a persistant daemon:

docker run -d --restart always \
  -e PROVIDER=cloudflare \
  -e CLOUDFLARE_APIKEY=YOUR_API_KEY \
  -e CLOUDFLARE_ZONE=YOUR_ZONE \
  -e CLOUDFLARE_HOST=YOUR_DOMAIN \
  -e CLOUDFLARE_EMAIL=YOUR_CLOUDFLARE_EMAIL \
  hugomd/cloudflare-ddns -duration 2h

Supported Providers

Provider Reference (used for PROVIDER environment variable)
Cloudflare cloudflare

Environment Variables

All providers require the following environment variable:

Environment Variable Description Example Required
PROVIDER The name of the provider you wish to use cloudflare true

Cloudflare

Environment Variable Description Example Required
CLOUDFLARE_APIKEY Cloudflare API key 12345 true
CLOUDFLARE_ZONE Cloudflare Zone example.com true
CLOUDFLARE_HOST The record you want to update subdomain.example.com true
CLOUDFLARE_EMAIL Email associated with your Cloudflare account john.doe@example.com true
Parameter Description Example Required
-duration Runs program perpetually and recheck after specified interval; parses time strings such as 5m, 15m, 2h30m5s. If not specified, or if equal to 0s, run once and exit. 2h false

Contributing

Adding a new provider

To add a new provider:

  1. Create a new folder in lib/providers, called your_provider
  2. Create a package for your provider in the previously created folder, your_provider.
  3. Ensure your provider implements the Provider interface
  4. Import your provider in lib/providers/_all/all.go
  5. Open a PR πŸŽ‰

License

MIT, see LICENSE.

About

Zero dependency dynamic DNS 🐳

License:MIT License


Languages

Language:Go 92.4%Language:Dockerfile 7.6%