modulepackage
0.0.0-20240507192518-a264c9071a71
Repository: https://github.com/tiewei/ddns.git
Documentation: pkg.go.dev
# README
ddns
ddns, as its name indicated, is a Dynamic DNS service, currently supports cloudflare.
Run
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_ZONE
as the record name, otherwise will use$DDNS_SUBDOMAIN.$DDNS_ZONE
as the record nameDDNS_PROXIED
- (optional), the flag to set the record in proxied mode or not, default isfalse
, set value toy
oryes
to set it proxied.DDNS_INTERVAL
- (optional), the interval between reconciling the records, in golang duration string format, default5m
. The program will use5m
if the interval is less than5m
or failed to parse the value provided.
Run as systemd service
To create a systemd service for ddns:
- Copy the
[email protected]
underetc
directory to/lib/systemd/system
(may be different on different distro). - Create
example.rc
under/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
Creating a Cloudflare API token
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
# Packages
No description provided by the author
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author