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