Skip to content
Zero dependency dynamic DNS 🐳
Go Dockerfile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib/providers
.travis.yml
Dockerfile
LICENSE
README.md
main.go

README.md

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

You can load environment variables through a config file of key/value pairs.

echo "PROVIDER=YOUR_PROVIDER" > config.env
docker run \
  -v $PWD/config.env:/tmp/config.env \
  hugomd/cloudflare-ddns -config /tmp/config.env

Supported Providers

Provider Reference (used for PROVIDER environment variable)
Cloudflare cloudflare

CLI

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
-config Loads environment variables from a given file. Variables should be specified as lines of key=value pairs. No variables will be loaded if a file is not specified. /tmp/config.env false

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

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.

You can’t perform that action at this time.