Git Product home page Git Product logo

cloudflare-dns's Introduction

cloudflare-dns-update

Usage

  cloudflare-dns (get|update|auto-update|show-ip) [-h] [-z ZONE_ID] [-n NAME] [-t TYPE] [-l TTL] [-v VALUE]
    get:         Get DNS record (type and name should be specified)
    update:      Update DNS A record
    auto-update: Update DNS A record using IP_SUPPLIER_SCRIPT
    show-ip:     Show IP address using IP_SUPPLIER_SCRIPT
          -z : Cloudflare zone ID
          -n : DNS record name (ex: example.com)
          -t : DNS record type (ex: A, CNAME, TXT, ...)
          -v : DNS record value
            -l : TTL to set (optional)
          -V : Verbode mode
          -h : display usage

Configuration file

You can configure some options in ${HOME}/.cloudflare-dns.conf /etc/cloudflare-dns.conf ./cloudflare-dns.conf. Here is example configuration.

CLOUDFLARE_API_TOKEN=XXXXXXXXXXXXXXXXXXXX
ZONE_ID=XXXXXXXXXXXXXXXXXXXX
IP_SUPPLIER_SCRIPT=\"/usr/local/bin/xxxx\"

If both files are specified, ./cloudflare-dns.conf will take precedence.

Example

  • Get all record set of specified zone. cloudflare-dns get -z ZONE_ID -V

  • Get Sepcified DNS record. cloudflare-dns get -z ZONE_ID -t A -n example.com

  • Update DNS A record. cloudflare-dns update -z ZONE_ID -t A -n example.com -v IP_ADDRESS

  • Auto-Update DNS A record. (IP address is auto-accuired using IP_SUPPLIER_SCRIPT specified in cloudflare-dns.conf) cloudflare-dns auto-update -z ZONE_ID -t A -n example.com

Installing systemd unit files

sudo cp systemd/cloudflare-dns.* /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable cloudflare-dns.timer
sudo systemctl start cloudflare-dns.timer

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.