GithubHelp home page GithubHelp logo

gringus / fritzbox-cloudflare-dyndns-nginx-lua Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 6 KB

Simple FRITZ!Box nginx based self-hosted proxy for updating Cloudflare DNS records

License: MIT License

Lua 100.00%
cloudflare dyndns fritzbox luajit nginx

fritzbox-cloudflare-dyndns-nginx-lua's Introduction

fritzbox-cloudflare-dyndns-nginx-lua

Simple FRITZ!Box self-hosted proxy for updating Cloudflare DNS records which runs exclusively in nginx with LuaJIT support.

Requirements

Setup

Cloudflare API Token

Create Cloudflare API Token with Zone Edit permissions (Zone.DNS.Edit) for the specific zone. Write down the token.

nginx

  • Clone repository
$ git clone [email protected]:gringus/fritzbox-cloudflare-dyndns-nginx-lua.git
  • Copy lua,dyndns.conf and cf-token.conf to nginx configuration directory
# cp -r lua dyndns.conf cf-token.conf /etc/nginx
  • Update cf-token.conf

Edit cf-token.conf file by updating the token value obtained in Cloudflare API Token step. Make sure file is protected:

# chmod 0400 /etc/nginx/cf-token.conf
  • Create authentication file

Select username and password (some_username and some_password in the example) for endpoint authentication.

# echo -n "some_username:$(openssl passwd -1 'some_password')" > /etc/nginx/dyndns.auth

Make sure file is protected and readable at runtime:

# chmod 0440 /etc/nginx/dyndns.auth
# chgrp nginx /etc/nginx/dyndns.auth
  • Add endpoint configuration

Either copy and paste snippet from dyndns.conf file or include it in nginx.conf eg.

include dyndns.conf;

FRITZ!Box

Enable DynDNS (Internet -> Permit Access -> DynDNS -> Use DynDNS) and configure:

  • Update URL

URL to self hosted instance including endpoint path (/dyndns by default) eg. https://example.com/dyndns?hostname=<domain>&ipv4=<ipaddr>&ipv6=<ip6lanprefix>&ipv6offset=::1 Supported endpoint parameters:

Parameter Example Description
hostname <domain> FQDN of existing DNS record to update. No new records get created.
ipv4 <ipaddr> The value of A record
ipv6 <ip6addr> or <ip6lanprefix> The value of AAAA record
ipv6offset ::1 Optional ipv6 offset (eg. when <ip6lanprefix> used as value) in IPv6 address notation. The final value of AAAA record will be a sum of ipv6 and ipv6pffset parameters eg. 2001:1234:: and ::ff0 will give 2001:1234::ff0
  • Domand name

FQDN which FRITZ!Box will use to watch for DNS changes. It seems FRITZ!Box will query Update URL only when Domain name A record value is different than IPv4 address obtained from ISP.

  • Username

Username used when querying Update URL. This should match username in nginx authentication file created in nginx step.

  • Password

Password used when querying Update URL. This should match password in nginx authentication file created in nginx step.

fritzbox-cloudflare-dyndns-nginx-lua's People

Contributors

gringus avatar

Stargazers

 avatar

Watchers

 avatar

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.