A modern, production‑ready Cloudflare DDNS updater with multi‑domain support, allowing each domain to have its own authentication method, API key, zone ID, record name, TTL, and proxy settings.
- Multi‑domain support via
domains.json - Each domain can define:
AUTH_EMAILAUTH_METHOD(globalortoken)AUTH_KEYZONE_IDENTIFIERRECORD_NAMETTLPROXYSITENAME
- Shared global configuration using
.env - Minute‑based scheduled updates using
node-cron - Winston logging: colored console +
./logs/ddns.log - Optional notifications:
- ntfy
- Telegram
- Slack
- Discord
- Built‑in
GET /heartbeatendpoint - Lightweight, minimal dependencies
git clone https://github.com/youruser/cloudflare-ddns-multi.git
cd cloudflare-ddns-multinpm installSITENAME=CloudflareDDNS
NTFY_URI=
TELEGRAM_TOKEN=
TELEGRAM_CHAT_ID=
SLACK_URI=
SLACK_CHANNEL=
DISCORD_URI=
HEARTBEAT_PORT=8999Create a file named domains.json:
[
{
"ENABLED": true,
"AUTH_EMAIL": "your@mail.com",
"AUTH_METHOD": "global",
"AUTH_KEY": "YOUR_CF_GLOBAL_KEY",
"ZONE_IDENTIFIER": "zone_id_here",
"RECORD_NAME": "example.com",
"TTL": 3600,
"PROXY": true,
"SITENAME": "example.com"
},
{
"ENABLED": true,
"AUTH_EMAIL": "info@another.com",
"AUTH_METHOD": "token",
"AUTH_KEY": "YOUR_CF_API_TOKEN",
"ZONE_IDENTIFIER": "another_zone_id",
"RECORD_NAME": "anotherdomain.com",
"TTL": 300,
"PROXY": false,
"SITENAME": "anotherdomain.com"
}
]You may add any number of domains.
Each domain is processed independently.
Start the updater using:
node app.jsor:
npm startThe script will:
- Detect the public IP
- Load all enabled domains from
domains.json - Compare existing Cloudflare records
- Update changed A records
- Log & optionally notify
A minimal health‑check endpoint:
GET /heartbeatExample response:
{
"status": "ok",
"timestamp": "2025-05-29T07:55:34.156Z"
}All logs are stored in:
./logs/ddns.log
Example log entries:
[2025-05-29T07:55:00.000Z] INFO - foglaljon.online updated to IP 12.34.56.78
[2025-05-29T07:55:01.432Z] INFO - ewa.agency updated to IP 12.34.56.78
- Docker support\
- Email notification support\
- Web dashboard for editing domains.json
Made with caffeine, curiosity, and questionable sleep patterns.
Always run DDNS scripts before your morning coffee --- risky, but fun.
MIT © 2025 -- https://github.com/hunnomad