mirror of
https://github.com/qdm12/ddns-updater.git
synced 2026-08-02 02:28:40 -04:00
2.0 KiB
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. It should be left to"@", since subdomain and wildcards ("*") are not really supported by Cloudflare it seems. See this issue comment for context. This is left as is for compatibility."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
- Email
Optional parameters
"proxied"can be set totrueto use the proxy services of Cloudflare"ip_version"can beipv4(A records) oripv6(AAAA records), and defaults toipv4 or ipv6
Domain setup
-
Make sure you have
curlinstalled -
Obtain your API key from Cloudflare website (see this)
-
Obtain your zone identifier for your domain name, from the domain's overview page written as Zone ID
-
Find your identifier in the
idfield withZONEID=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.