Giter Club home page Giter Club logo

cloudflare-dyndns2's Introduction

cloudflare-dyndns2

cloudflare-dyndns2 is a dyndns2 API compatible server you can use in Cloudflare workers to update A/AAA records with generic dyndns2 clients like ddclient, python-dyndnsc and many others (like your consumer router, potentially).

Setup

You need a Cloudflare account (free plan is fine) with a domain configured and two API tokens created:

  • CF_ZONE_API_TOKEN: With Zone / Zone / Read permissions, scoped to all your zones.
  • CF_DNS_API_TOKEN: With Zone / DNS / Edit permissions, scoped to the domain you want to update.

To set up cloudflare-dyndns2, follow the Cloudflare Workers: Get started guide until you have a logged in wrangler config.

  • Run wrangler whoami to get your Account ID
  • Copy wrangler.toml.tmpl to wrangler.toml
  • Add your Account ID to wrangler.toml
  • Choose a username and it to the BASIC_USER variable in wrangler.toml

Now add the tree required secrets using wrangler:

# A password of your choosing
wrangler secret put BASIC_PASS
# The Cloudflare API tokens you created
wrangler secret put CF_ZONE_API_TOKEN
wrangler secret put CF_DNS_API_TOKEN

After that you can publish the code by calling:

wrangler publish

You now need to create the A/AAAA records you want to update with your desired settings via the Cloudflare UI (or API). cloudflare-dyndns2 will only update existing records and won't create new ones.

Client configuration

There are two routes that currently do the same thing, /nic/update and /v3/update. For details, please see: https://help.dyn.com/remote-access-api/perform-update

Currently, only the parameters hostname and myip are supported (in addition to a json parameter that makes the API return JSON instead of dyndns2 compatible responses). Multiple hostnames, as well as IPv4 and IPv6 are supported (separated by comma). If multiple IPs of the same type are provided, only the first one is used.

Update URLs:

  • https://<worker-fqdn>/v3/update?hostname=<your-fqdn1>,<your-fqdn2>&myip=<ipv4>,<ipv6>
  • https://<worker-fqdn>/nic/update?hostname=<your-fqdn1>,<your-fqdn2>&myip=<ipv4>,<ipv6>

A ddclient config for IPv6 might look something like:

protocol=dyndns2
usev6=if, if=eth0
ssl=yes
server=<worker-fqdn>
login=<BASIC_USER>
password='<BASIC_PASS>'
<your-fqdn>

cloudflare-dyndns2's People

Contributors

jayme-github avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

iseppi

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.