Skip to content

MacGurk/cloudflare-ip-update

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Cloudflare IP update

Script to dynamically update DNS-Record on cloudflare if IP of server has changed.

Credit to nfahrni for the initial version.

Config file

File named config.json must be present in same directory as ip_update.py. The file must contain following data

{
  "zones": [
    {
      "name": "domain.ch",
      "zone_id": "z0n3_1D"
    }
  ],
  "cloudflare_api_token": "Cl0uDfl4r3_aP1_t0k3n"
}

Log file

Errors and infos get logged to ip_update.log in the same directory of the script. If the logfile exceeds 5MB, a new file will be created, up to 10 logfiles will be retained.

Run scheduled

Script can run automatically via cron.

Edit crontab with crontab -e.

Example crontab to run all 5 minutes, replace the path:

*/5 * * * * python3 /path/to/ip_update.py

See crontab man page or crontab guru for reference.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages