Skip to content
DNS records updater for use with CloudFlare.
Python
Branch: master
Clone or download
salaheldinaz Multi DNS records update
Add option to add more dns records to update .
Latest commit a065868 Apr 28, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
classes Multi DNS records update Apr 28, 2019
.gitattributes Initial commit Apr 7, 2019
.gitignore fix updater Apr 21, 2019
LICENSE Initial commit Apr 7, 2019
README.md Multi DNS records update Apr 28, 2019
first_time.py Multi DNS records update Apr 28, 2019
requirements.txt Initial commit Apr 7, 2019
screenshot.png update title figlet Apr 9, 2019
updater.py Multi DNS records update Apr 28, 2019

README.md

CloudFlare DNS Updater

version v1

DNS records updater for use with CloudFlare. Written in Python using CloudFlare API v4.

I made this mainly to update my domain DNS A record daily.

screenshot

Prerequisite

  • Python 3.5+
  • Python modules:
    • simplejson
    • style
    • requests

To install python required modules :

pip3 install -r requirements.txt

Installing

This script can be run from terminal, no install required.

API Keys will be saved in api_data.json

Logs will be saved in cf.log

Configuration

  1. Run first_time.py
python3 first_time.py
  1. Enter your details :
API Key: The API key given by CloudFlare at the bottom of your "My Account" page
  1. Select domain and dns record to update.
Domain: The root domain name you wish to update (example.com).
Email: The email address associated with your CloudFlare account.

Schedule update

Once you have verified the application is updating your records as intended, you may schedule it to run at regular time intervals. Add updater.py to your schedule tasks software.

Example: In linux I use crontab to check and update server ip every day at 12:30 a.m:

29 0 * * * /usr/bin/python3 /path/to/updater.py

Todo list

  • Add more detailed error messages
  • Filter DNS records to just records accept ip as value

External Resources

Cloudflare API documentation

You can’t perform that action at this time.