Giter VIP home page Giter VIP logo

cloudflare-dyndns-dualstack's Introduction

cloudflare-dyndns-dualstack

Introduction

A script for dynamically updating a CloudFlare DNS record for A or AAAA records or both.

I wrote this because I couldn't find anything that supports doing both IPv4 and IPv6 at the same time.

Dependencies

You'll need a python interpreter along with the requests, netifaces and cloudflare modules:

You can install them with pip :

pip install -r requirements.txt

Usage

Running the script

python3 cloudflare-dyndns-dualstack.py domain.example.com

Only use ipv4

python3 cloudflare-dyndns-dualstack.py --no-ipv6 domain.example.com

Only use ipv6

python3 cloudflare-dyndns-dualstack.py --no-ipv4 domain.example.com

Setup

STEP 1 (CloudFlare credentials)

Configure your cloudflare credentials. The official cloudflare module retreives them from either the users exported shell environment variables or the .cloudflare.cfg or ~/.cloudflare.cfg or ~/.cloudflare/cloudflare.cfg files, in that order.

Using shell environment variables

$ export CF_API_EMAIL='[email protected]'
$ export CF_API_KEY='00000000000000000000000000000000'
$

These are optional environment variables; however, they do override the values set within a configuration file.

Using configuration file to store email and keys

$ cat ~/.cloudflare/cloudflare.cfg
[CloudFlare]
email = [email protected]
token = 00000000000000000000000000000000
$

cloudflare-dyndns-dualstack's People

Contributors

andrewjeffree avatar imperialxt avatar

Watchers

 avatar

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.