nelsonxb / caddy-dyndns

Dynamic DNS handler for Caddy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dynamic DNS handler for Caddy

A caddy v2 plugin for dealing with dynamic DNS setups. See the documentation for DynDnsHandler for more details.

Installing

Build a custom Caddy:

$ go install github.com/caddyserver/xcaddy@latest
$ xcaddy build \
    --with github.com/nelsonxb/caddy-dyndns \
    --with github.com/caddy-dns/...

Setting up

This plugin was mainly developed to use with a FRITZ!Box. You might find a setup like the following useful:

{
    "apps": {
        "http": {
            "servers": {
                "default": {
                    "routes": [{
                        "match": [{
                            "remote_ip": { "ranges": ["192.168.178.1"] },
                            "path": ["/.ddns"]
                        }],
                        "handle": [
                            {
                                "handler": "authentication",
                                "providers": {
                                    "http_basic": {/*...*/}
                                }
                            },
                            {
                                "handler": "dyndns",
                                "domain": "my.domain.com",
                                "provider": {/* dns.providers.* */}
                            }
                        ]
                    }]
                }
            }
        }
    }
}

Then, in the FRITZ!Box, configure DynDNS using the User-defined provider:

Setting Value
Update URL http://192.168.178.x/.ddns?4=<ipaddr> http://192.168.178.x/.ddns?6=<ip6addr> (or <ip6addr> could be <ip6lanprefix>, also note the two space-separated URLs)
Domain name my.domain.com
User name As configured in Caddy
Password As configured in Caddy

About

Dynamic DNS handler for Caddy

License:BSD 2-Clause "Simplified" License


Languages

Language:Go 100.0%