Coder Social home page Coder Social logo

cf-dyndns-worker's Introduction

A dyndns provider in a CloudFlare worker

With me using CloudFlare and CloudFlare providing free workers, why would I bother with shady dyndns providers, it should be simple enough to implement myself.

This is what I came up with.

Setup

You need wrangler to set this up.

You'll also need to create a few secrets (wrangler secret put [-e prod] <NAME>):

  • CF_TOKEN: a token with edit permission on the zone's DNS (go to your profile and create a token with the DNS:Edit permission on your CF Zone)
  • CF_ZONE: the CF zone id, as listed on the dashboard of the zone (scroll down, it's in the sidebar)
  • DOMAIN: the record in the zone to set
  • PASSWORD: the key to use to make sure people don't just update your DNS...
wrangler publish -e prod

Setup notes

I recommend setting the DOMAIN secret to a random sub domain and then pointing a CloudFlare proxied CNAME to it. That way, it is harder to find out what your home IP is.

Routes

  • /dyndns: the URL you should point your script to. Accepts the following get parameters:
    • ipv4: the new IPv4
    • ipv6: the new IPv6
    • password: the password you chose in the step above
  • /current-ip: returns the IP of the caller (use curl -4 or curl -6 to make sure you get the right IP)
    • Note that the IPv6 returned here is not necessarily the IP of your router since NATing is not always used with IPv6

cf-dyndns-worker's People

Contributors

bendem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

bxb100 ieng666

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.