Cloudflare IP Updater

Docker container für DNS updates

What is the Cloudflare IP Updater?

The Cloudflare IP Updater (or “CF Updater” for short) is a small go binary in a Docker container that detects changes to the public IP address of a server and adjusts it in the Cloudflare DNS. The goal is to minimize the downtime of services behind internet connections with changing IP addresses. Especially for “hobby hosters” this is of course interesting.

Originally, the Cloudflare Updater was developed in Python, but after some time rewritten in Go. The reason for this was a better runtime stability and it was easier to implement concurrency to be able to propagate the update of DNS records in the event of an IP change faster (so-called “Emergency Mode”). The full name of the new Go implementation is “New CF Updater”.

CLI Log of the CF Updater
CLI Log of the CF Updater

The CF Updater is used productively on all hosts of leon.wtf and leon-schmidt.dev!

Configuration

The CF Updater offers a much more modern, flexible and stable approach here in contrast to ddclient: The tool is configured via a JSON file and allows granular configuration for each host, but also has customizable default values. For example, updating AAAA records can be disabled for specific hosts only.

Example configuration

{
    "api_token": "some-secret-key",
    "update_ipv4_default": true,
    "update_ipv6_default": true,
    "check_interval": 30,
    "check_timeout": 5,
    "zones": {
        "leon-schmidt.dev": [
            {
                "name": "leon-schmidt.dev",
                "create": true // adds the records if it doesn't exis
            },
            {
                "name": "analytics.leon-schmidt.dev",
                "proxy": true, // activates the Cloudflare Proxy (null = keep current setting)
                "update_ipv6": false // deactivates AAAA record update for this host only
            }
        ]
    }
}

Differentiation from similar tools

  • The CF Updater has full IPv6 support, even when NAT is applied.
  • The current IP is determined via Cloudflares trace service. So no data flows to external services – except Cloudflare itself, of course.
  • For requests to Cloudflares trace service, the IP address is always used – the current IP can therefore be determined even without a working DNS, which speeds up the propagation of the values.
  • Supports the setting of the proxy state per record.
  • It is possible to specify whether new records should be created if they do not already exist.
  • Supports multiple Cloudflare zones simultaneously.