Update DNS entries in Cloudflare and use Cloudflare as a DDNS provider.
10K+
Update DNS entries in Cloudflare and use Cloudflare as a DDNS provider.
git clone https://github.com/SrGMC/cloudflare-ddns.gitnpm install.config.json and change the following:
zone_id: Zone ID assigned to the Zone you want to update.zone_name: The name of the Zone you want to update.auth_email: The email used to login into your Cloudflare account.auth_key: Your global API key. This can be obtained in My Profile > API Tokens > Global API Key.records: The DNS records you want to update. You can add as many as you want:
@ is the root domain.time (optional): Interval (in ms) of updates.bypass (optional): Set every record as non-proxied.npm start or node index.jsNote: config.json takes precedence to the optional arguments
A SystemD Service file is provided in this repository. The steps to install are the following
cloudflare-ddns.service to /etc/systemd/system/cloudflare-ddns.servicenode is executed from /usr/local/bin/node. This can be checked with which nodesudo systemctl enable cloudflare-ddns.servicesudo systemctl start cloudflare-ddns.servicenode index.js [-h] [-v] [-t TIME] [-b BYPASS]
-h, --help: Show help message and exit-v, --version: Show program's version number and exit-t TIME, --time TIME: Interval (in ms) of update-b BYPASS, --bypass BYPASS: Bypass proxy. Set every record as non-proxiedThis script is set up to update DNS records every 30 min.
This script is available as a Docker container in srgmc/cloudflare-ddns
srgmc/cloudflare-ddns:latest: Latest versionsrgmc/cloudflare-ddns:armv7l: Latest version compiled form ARMv7docker-compose.yamlversion: "3"
networks:
default:
driver: bridge
services:
cloudflare-ddns:
image: srgmc/cloudflare-ddns:latest
volumes:
- /path/to/config.json:/usr/src/app/config.json
restart: unless-stopped
Remember to change /path/to/config.json, as this is requiered in order to be able to connect and update DNS records.
Content type
Image
Digest
Size
39.1 MB
Last updated
over 5 years ago
docker pull srgmc/cloudflare-ddns