Code Monkey home page Code Monkey logo

py-cloudflare-ddns's Introduction

py-cloudflare-ddns

Table of Contents

Installation

git clone https://github.com/dmoruzzi/py-cloudflare-ddns.git

Operation

py-cloudflare-ddns is a command line tool. It has the following operations:

usage: py-cloudflare-ddns.py [-h] --zoneid ZONEID --recordid RECORDID --apikey APIKEY --email EMAIL --recordname
                             RECORDNAME [--recordtype RECORDTYPE] [--insecure INSECURE] [--verbose VERBOSE]
                             [--protocol PROTOCOL]

options:
  -h, --help            show this help message and exit
  --zoneid ZONEID       CloudFlare Zone ID; https://developers.cloudflare.com/fundamentals/get-started/basic-
                        tasks/find-account-and-zone-ids/
  --recordid RECORDID   Cloudflare Record ID; https://api.cloudflare.com/#dns-records-for-a-zone-list-dns-records
  --apikey APIKEY       Cloudflare API Key; https://dash.cloudflare.com/profile/api-tokens
  --email EMAIL         Email
  --recordname RECORDNAME
                        Record Name
  --recordtype RECORDTYPE
                        DNS record type (default: "A")
  --insecure INSECURE   allow insecure Global API Key access
  --verbose VERBOSE     Verbose output (default: False)
  --protocol PROTOCOL   DNS record protocol (default: "ipv4")

This CLI application is best maintained through a cron job. For example, to run this script every 24 hours, add the following line to your crontab:

0 0 * * * /path/to/py-cloudflare-ddns.py --zoneid <zoneid> --recordid <recordid> --apikey <apikey> --email <cloudflare_email> --recordname <recordname>

Limitations

This script is currently limited to updating a single DNS record. If you would like to update multiple records, you can run this script multiple times with different arguments. You can also run this script multiple times with the same arguments, but this is not recommended :P

Acknowledgements

The CloudFlare API team is incredible for providing detailed and granular access to their REST API. This script is a wrapper for all the hardwork Cloudflare dedicated to the Internet. Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.