ddns, as its name indicated, is a Dynamic DNS service, currently supports cloudflare.
It follows the 12 factor app, all its configuration comes from environments
DDNS_API_TOKEN- (required), the cloudflare token, see Creating a Cloudflare API tokenDDNS_ZONE- (required), the domain zoneDDNS_SUBDOMAIN- (optional), if not provided, will use the value ofDDNS_ZONEas the record name, otherwise will use$DDNS_SUBDOMAIN.$DDNS_ZONEas the record nameDDNS_PROXIED- (optional), the flag to set the record in proxied mode or not, default isfalse, set value toyoryesto set it proxied.DDNS_INTERVAL- (optional), the interval between reconciling the records, in golang duration string format, default5m. The program will use5mif the interval is less than5mor failed to parse the value provided.
To create a systemd service for ddns:
- Copy the
[email protected]underetcdirectory to/lib/systemd/system(may be different on different distro). - Create
example.rcunder/etc/ddns, the content would be the environment variables from above section - Start your service
systemctl start ddns@example - Enable your service
systemctl enable ddns@example
To create a CloudFlare API token for your DNS zone go to https://dash.cloudflare.com/profile/api-tokens and follow these steps:
- Click Create Token
- Provide the token a name, for example, cloudflare-ddns
- Grant the token the following permissions:
- Zone - Zone Settings - Read
- Zone - Zone - Read
- Zone - DNS - Edit
- Set the zone resources to:
- Include - All zones
- Complete the wizard and copy the generated token into the API_KEY variable for the container