You may also have a look at the official CLI version of Cloudflare-DDNS-Sync:
Cloudflare-DDNS-Sync is a simple NPM package that updates the IP address of Cloudflare DNS records.
The goal of Cloudflare-DDNS-Sync is to make updating the IP of Cloudflare DNS records as easy as possible.
- Node
- Cloudflare Account
To install Cloudflare-DDNS-Sync simply run:
npm install cloudflare-ddns-sync
in your project folder.
var CloudflareDDNSSync = require("cloudflare-ddns-sync");
var ddnsSync = new CloudflareDDNSSync({
"auth" : {
"email" : "your@email.com",
"key" : "your_cloudflare_api_key"
},
"domain": "your-domain.com",
"records" : [
"subdomain.your-domain.com",
"subdomain2.your-domain.com"
],
});
ddnsSync.sync()
.then((results) => {
for(var result of results){
console.log(result);
}
});
Hint: If a record is not existing, CDS will automatically create it when syncing.
- getIp()
- getRecordIps()
- sync(<ip>)
- syncOnIpChange(<callback>)
- syncByInterval(interval, <ip>, <callback>)
- syncOnceEveryHour(minute, <ip>, <callback>)
- syncOnceEveryDay([hour, <minute>], <ip>, <callback>)
- syncOnceEveryWeek([dayOfWeek, <hour>, <minute>], <ip>, <callback>)
- syncOnceEveryMonth([dayOfMonth, <hour>, <minute>], <ip>, <callback>)
- syncByCronTime(cronTime, <ip>, <callback>)
- syncAtDate(date, <ip>, <callback>)
- syncByTimestring(timestring, <ip>, <callback>)
- stopSyncOnIpChange()
For a more detailed view, have a look at the Documentation
- Go to Cloudflare
- Log In
- In the upper right corner: click on your email address
- Go to "My Profile"
- In the "API Key"-Section: click on the "View API Key"-Button of the Global Key
- Enter your password and fill the captcha
- Copy the API Key
- 📝 Update README
- 🐛 Fix Stopping Sync On IP Change
- 🐛 Fix Crontime Converter For Hour
- 🐛 Fix Syncing With Crontime Without Setting an IP
- ⚡️ Small Performance Improvements
- 💄 Improve Code Quality
- 💄 Extract Business Rules
- 🐛 Fix Wrong Using of Const
- 🐛 Fix Bug When 'public-ip' Throws An Error
- 💄 Improve Code Quality
- ✨ Add Create Not Existing Records Functionality
- ✨ Add Fallback getIp Function
- ✨ Add Stop SyncOnIpChange Function
- 🐛 Fix ipChange Interval
- 📝 Add Changelog
- ✨ Add getRecordIps Function
- ♻️ Refactor syncOnIpChange
- ✅ Add Tests for Sync Functionality
- 📝 Improve README
- 📝 Add NPM Badge
- 🔥 Remove Unnecessary Code
- 🚸 Update Description
- 🎨 Order Dependencies
- 🎨 Lint files
- 📝 Fix README
- ✨ Add syncAtDate Function
- 📝 Improve README
- 🚑 Fix README
- ✨ Add onIpChange Function
- 📝 Adjust README
- 🚚 Move Utils to Lib
- 🚚 Move IP Functions to Lib
- 🚚 Move Dependencies to devDependencies
- 🔧 Update Eslint Config
- 🎨 Fix Eslit Error
- ⚡️ Improve Performance of First Sync
- ✨ Add Schedule Functionality
- 🚸 Improve Success Message of Sync Function
- 📝 Fix Typos in README
- 📝 Add Schedule Functions to README
- ✅ Add Unittests
- ✨ Add Eslint
- 📝 Fix Typo in README
- 📄 Add LICENSE
- 📝 Add "Get Your Cloudflare Api Key"-Section to README
- ✨ Add sync Function -> changes the IP of the configured DNS records on Cloudflare
- ✨ Add getIp Function -> returns the external IP
- 📝 Add README