Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DynDnsHandler ¶
type DynDnsHandler struct { // The DNS provider module to use for updating the DNS records. // Note that providers that satisfy the requirements for ACME // don't necessarily work here. // // Providers that simply forward to libdns should be fine. ProviderRaw json.RawMessage `json:"provider" caddy:"namespace=dns.providers inline_key=name"` // The full domain name to get updated. Domain string `json:"domain"` // The DNS zone to update. This will likely be the root domain // that you purchased. If omitted, defaults to a suffix of the domain. // If specified, must be a suffix of the domain. // // Note that the suffix guesswork is currently very naïve - // the second-last component is considered to be the zone. // This doesn't always work - for example, the domain `sub.example.co.nz` // will produce a zone of `co.nz` (even though you would probably want // `example.co.nz`). Zone string `json:"zone,omitempty"` // An optional address to use, to override the local IPv6 address. // When specified, if a new IPv6 address only sets the high half // (i.e. the new address is a subnet range), // the low half will be filled with the matching low half // specified in this field. // // This can either be an IPv6 address, // or a domain name to look up // (may be useful within a Docker container). LanIPv6 string `json:"ipv6,omitempty"` Provider libdns.RecordSetter `json:"-"` // contains filtered or unexported fields }
Handles a notification that an IP address has changed. On any request, checks the query parameters for IP addresses, then updates the domain given in the configuration.
When any HTTP request is submitted, it checks for query parameters "4" and "6". For example, `GET /?4=123.234.210.2&6=2000:80::52:3` - this then updates the configured DNS provider with corresponding A and AAAA records. Either one or both of these parameters may be specified in a request. If the IPv6 address is given as a CIDR prefix (e.g. `/?6=2000:80::/64`), then the unmasked space is filled based on the address specified in the ipv6 field.
func (*DynDnsHandler) CaddyModule ¶
func (*DynDnsHandler) CaddyModule() caddy.ModuleInfo
func (*DynDnsHandler) Provision ¶
func (ddns *DynDnsHandler) Provision(ctx caddy.Context) error
func (*DynDnsHandler) ServeHTTP ¶
func (ddns *DynDnsHandler) ServeHTTP(w http.ResponseWriter, req *http.Request, _ caddyhttp.Handler) error
Click to show internal directories.
Click to hide internal directories.