Files
ddns-updater/docs/cloudflare.md
Quentin McGaw 6bf82d7be1 Wiki in repository (#128)
* Split provider specific instructions in docs/
* Update links to be relative
* Update Google doc, co-authored by @gauravspatel
2020-12-12 19:38:21 -05:00

2.0 KiB

Cloudflare

Configuration

Example

{
  "settings": [
    {
      "provider": "cloudflare",
      "zone_identifier": "some id",
      "domain": "domain.com",
      "host": "@",
      "ttl": 600,
      "token": "yourtoken",
      "ip_version": "ipv4"
    }
  ]
}

Compulsory parameters

  • "zone_identifier" is the Zone ID of your site
  • "domain"
  • "host" is your host and can be a subdomain, "@" or "*" generally
  • "ttl" integer value for record TTL in seconds (specify 1 for automatic)
  • One of the following:
    • Email "email" and Global API Key "key"
    • User service key "user_service_key"
    • API Token "token", configured with DNS edit permissions for your DNS name's zone

Optional parameters

  • "proxied" can be set to true to use the proxy services of Cloudflare
  • "ip_version" can be ipv4 (A records) or ipv6 (AAAA records), and defaults to ipv4 or ipv6
  • "no_dns_lookup" can be set to true to prevent the program from doing assumptions from DNS lookups returning an IP address not matching your public IP address. This is especially useful if you set "proxied": true.

Domain setup

  1. Make sure you have curl installed

  2. Obtain your API key from Cloudflare website (see this)

  3. Obtain your zone identifier for your domain name, from the domain's overview page written as Zone ID

  4. Find your identifier in the id field with

    ZONEID=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    EMAIL=example@example.com
    APIKEY=aaaaaaaaaaaaaaaaaa
    curl -X GET "https://api.cloudflare.com/client/v4/zones/$ZONEID/dns_records" \
        -H "X-Auth-Email: $EMAIL" \
        -H "X-Auth-Key: $APIKEY"
    

You can now fill in the necessary parameters in config.json

Special thanks to @Starttoaster for helping out with the documentation and testing.