Code Monkey home page Code Monkey logo

cloudflare_dns_record's Introduction

CloudFlare_DDNS_Setter

Build Status language author license

Script to set DDNS Record via CloudFlare

download

mkdir /home/CloudFlare_DDNS
cd /home/CloudFlare_DDNS
wget https://raw.githubusercontent.com/nanqinlang-script/CloudFlare_DNS_Record/Setter/CloudFlare_DDNS_Setter.sh
wget https://raw.githubusercontent.com/nanqinlang-script/CloudFlare_DNS_Record/Setter/config.conf

config

you should write your configuration down to config.conf :

# notice: the following interpretations("# ...") is not allowed in file "config.conf"
# do not write interpretations into config file

# the email address of your cloudflare account
email=

# the zone id of your cloudflare account
zone_id=

# the api key of your cloudflare account
api_key=

# the id of domain record you want to modify
# this id can be find via "get domain record_id" selection in the script
record_id=

# the domain you want to set
domain=

# ttl of record (seconds)
# min value:120
# max value:2147483647
ttl=

take a example, you should write like this:

email=example@gmail.com
zone_id=3456dfdhfi465ff4ae263ef35esd060f
api_key=84058228se28e28898b6ds3ej78yuf2136654

record_id=1d3a9b54623334f3debc20c56eb5585c
domain=example.example.net
ttl=120

usage

step 1

write those config down:

  • email
  • zone_id
  • api_key

step 2

then run

bash CloudFlare_DDNS_Setter.sh

and you will meet select required service :

1.get domain record_id
this function will list all your dns records
you should get the id of a dns record from the list and write it down to record_id in the config file

2.create new domain record
this function can create a new A dns record

step 3

continuously write those config down:

  • record_id
  • domain
  • ttl

step 4

after you finished step 1~3, you will need to run this :

bash CloudFlare_DDNS_Setter.sh --ddns

for above, the parameter --ddns is to update your dns A record to refresh your ddns. Freely let it automatically via such as crontab.

according

中文文档
https://sometimesnaive.org/article/5 (to be updated)

Cloudflare API documentation v4
https://api.cloudflare.com/#zone-properties

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.