Git Product home page Git Product logo

cloudflareddns's Introduction

Build Status Cloudflare Dynamic DNS Client

Classic Dynamic DNS clients based on IPv4. Currently even white dynamic IPv4 is quite rare thing. More and more providers use NAT and it's impossible to use classic dynamic dns to expose your home, testing or virtual server to the internet. Fortunately there is a lot of free IPv6 addresses (about 300 000 000 for each person on Earth). It's a good idea to use IPv6 instead of IPv4. But IPv4 is still most popular technology. The problem is IPv4 has no direct access to IPv6 and vice versa. Cloudflare provides transparent bridge from IPv4 to IPv6 for free. So IPv4 clients able to access IPv6 resources. The easiest way to get "white" IPv6 is teredo. Installation for Ubuntu:

sudo apt-get install miredo

That's all. Now your Ubuntu system has access to IPv6 resources over the internet. Now we want to expose local webserver globaly.

###Requirements

  • Cloudflare account (it's free)
  • Own domain that uses Cloudflare as DNS service
  • Enabled IPv6 support in domain settings (Settings->Cloudflate settings->Automatic IPv6=Full
  • API Key and Email from Cloudflare account settings

###Usage

Grab latest release from here or build cloudflareddns from sources.

./cloudflareddns -token=api_key_from_account_settings -email=email_from_account_settings -domains=mysubdomain.domain.com

That's it. Now your local web server will be available via web browser by http://mysubdomain.domain.com With "-ipv4only=true" option cloudflareddns will update only IPv4 address. "domains" could contain several comma-separated domains. Or you can create config.json file near cloudflareddns and specify all arguments there

{
  "token":"api_key_from_account_settings",
  "email":"email_from_account_settings",
  "domains":[
    "sub1.domain.com",
    "sub2.anotherdomain.com"
  ]
}

Use cron to run cloudflareddns periodicaly. For example, every hour:

crontab -e
0 * * * * /path/to/cloudflareddns arguments

To use cloudflareddns with runit, supervisord or another process control system there is "interval" argument:

./cloudflareddns -token=api_key_from_account_settings -email=email_from_account_settings -domains=mysubdomain.domain.com -interval=30

or

{
  "token":"api_key_from_account_settings",
  "email":"email_from_account_settings",
  "domains":[
    "sub1.domain.com",
    "sub2.anotherdomain.com"
  ],
  "interval":30
}

It means cloudflareddns will run "infinitely" and update IPs every 30 minutes.

###Building from source

  1. Install golang
  2. git clone https://github.com/nickalie/CloudflareDDNS.git
  3. cd CloudflareDDNS/src
  4. go build -o cloudflareddns main.go
  5. cloudflareddns ready to use

Step 4 for Windows:

go build -o cloudflareddns.exe main.go

cloudflareddns's People

Contributors

nickalie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

wcbzero poppy7921

cloudflareddns's Issues

How to restrict the program to only allow updating an existing DNS record (Disallow creating a new record)

Hi,

The context:
The program is used by a group of people. Each person is allowed to update a specific DNS record (Example: person01.domain.tld, person02.domain.tld, ...)

In order to avoid creating multiple DNS records (especially typos, ...), how to restrict the program to only allow updating an existing DNS record (Disallow creating a new record)?
Example, when running:
./cloudflareddns -token=api_key_from_account_settings -email=email_from_account_settings -domains=mysubdomain.domain.com

IF mysubdomain.domain.com exists,
update the DNS record with the new IP (if IP changed)

ELSE
Display a message "mysubdomain.domain.com does not exist"

Thank you

How to insert the values of the variables token and email inside the program

Hi,

We want to have the variables "token" and "email" embedded into the program and avoid sharing them. So, instead of using the config file config.json or entering the variables manually in the command line using the parameters -token= .... -email= ...., we want to run the program as follow:

cloudflareddns-updater -domains=subdomain.domain.tld

Where do we have to put the values of the variables "token" and "email" inside the program to achieve our goal?

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.