Categorygithub.com/heathcliff26/cloudflare-dyndns
repository
1.1.1
Repository: https://github.com/heathcliff26/cloudflare-dyndns.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# README

cloudflare-dyndns

Implements the API from Fritz!Box DynDNS Script for Cloudflare, but can also be used as a standalone client.

Additionally to consuming less resources and being a smaller image, it also implements POST in addition to GET requests, meaning no longer does the token need to be included in the url.

The client package can also be used as a golang API, should you want to build your application with included cloudflare dyndns capabilities.

Table of Contents

Container Images

Image location

Container RegistryImage
Github Containerghcr.io/heathcliff26/cloudflare-dyndns
Docker Hubdocker.io/heathcliff26/cloudflare-dyndns

Tags

There are different flavors of the image:

Tag(s)Description
latestLast released version of the image
rollingRolling update of the image, always build from main branch.
vX.Y.ZReleased version of the image

Usage

The binary can be run either as a server, a standalone client or in relay mode where it will call a server.

The main use case for relay mode would be when you want to restrict your cloudflare API key to a static IP.

Output of cloudflare-dyndns help

cloudflare-dyndns provides DynDNS functionality for cloudflare.

Usage:
  cloudflare-dyndns [flags]
  cloudflare-dyndns [command]

Available Commands:
  client      Update DDNS Records by calling the cloudflare API
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  relay       Update DDNS Records but relay the calls through a server
  server      Run a server for relay clients
  version     Print version information and exit

Flags:
  -h, --help   help for cloudflare-dyndns

Use "cloudflare-dyndns [command] --help" for more information about a command.

An example config can be found here.

Kubernetes

The container image can be deployed as part of a daemonset, to ensure all nodes in your cluster have a valid DNS record.

An example daemonset using the relay mode can be found here.

API (Server Mode)

ParameterDescription
token (cf_key)Token needed for accessing cloudflare api
domains (domain)The domain to update, parsed from comma (,) separated string, needs at least 1
ipv4IPv4 Address, optional, when IPv6 set
ipv6IPv6 Address, optional, when IPv4 set
proxyIndicate if domain should be proxied, defaults to true

Examples

Here is an example GET request:

https://dyndns.example.com/?token=testtoken&domains=foo.example.net,bar.example.org,example.net&ipv4=100.100.100.100&ipv6=fd00::dead&proxy=true

or alternatively in the format Fritz!Box DynDNS Script for Cloudflare from :

http://example.org/?cf_key=testtoken&domain=foo.example.net&ipv4=100.100.100.100&ipv6=fd00::dead&proxy=true

When using POST the format is:

{
  "token": "",
  "domains": [
    "foo.example.org",
    "bar.example.net"
  ],
  "ipv4": "100.100.100.100",
  "ipv6": "fd00::dead",
  "proxy": true
}