A daemon to use Cloudflare as a DDNS provider
Go to file
2020-03-22 23:31:53 +01:00
.github/workflows fix: Correct release artifact downloaded file names 2019-09-21 23:34:52 +02:00
.vscode chore: Bump up version number to 0.2.1 2020-03-22 23:31:50 +01:00
src feat: Better report different HTTP status responses 2020-03-22 23:30:42 +01:00
.gitignore chore: Add envrc to gitignore 2020-03-21 22:41:41 +01:00
Cargo.lock chore: Bump up version number to 0.2.1 2020-03-22 23:31:50 +01:00
Cargo.toml chore: Bump up version number to 0.2.1 2020-03-22 23:31:50 +01:00
LICENSE chore: Add LICENSE file 2019-09-17 13:47:23 +02:00
README.md docs: Update README with info on new config option 2019-09-23 11:03:00 +02:00

CloudFlare DDNS update tool

This is a simple CLI you can use to continuously update an A DNS record for a domain using CloudFlare's free DDNS service.

Options

    -k, --key <auth-key>     The auth key you need to generate in your Cloudflare profile
    -c, --cache <cache>      Cache file for previously reported IP address (if skipped the IP will be reported on every
                             execution)
    -f, --config <config>    Your TOML config file containing all the required options (email, auth_key, zone, domain)
                             which you can use instead of passing the arguments to the command line
    -d, --domain <domain>    The domain for which you want to report the current IP address
    -e, --email <email>      Your Cloudflare login email
    -z, --zone <zone>        The zone in which your domain is (usually that is your base domain name)

Config

You Can pass a path to a configuration file (-f or --config) instead of each option as a command line argument. The configuration should be a TOML file and hold the same options. Here's a sample:

email = "example@example.com"
auth_key = "secretkey"
domain = "example.example.com"
zone = "example.com"

Cloudflare Setup

You need to do some preparatory work in Cloudflare. Firstly this assumes you're using Cloudflare already to manage the DNS records for your domain.

Initial DNS setup

You need to add a type A DNS record for your domain. The Name field you should fill in with the name of the subdomain. If you don't want to use a subdomain just type @ then the base domain will be used. Then change the Proxy status field to be not Proxied but DNS only. This will allow you to input 0.0.0.0 in the IPv4 Address field. Then click the save button. You might need to wait sometime before the DNS record propagates.

API key

We need to authenticate ourselves in front of the Cloudflare API. To do so we need to an auth key to pass along as a password together with our login email. You can find the global API key in My profile > API Tokens.