An open API service indexing awesome lists of open source software.

https://github.com/joeig/dyndns-pdns

Dynamic DNS Collector for PowerDNS
https://github.com/joeig/dyndns-pdns

dyndns fritzbox powerdns

Last synced: 6 months ago
JSON representation

Dynamic DNS Collector for PowerDNS

Awesome Lists containing this project

README

          

# Dynamic DNS Collector for PowerDNS

Collects IPv4/IPv6 addresses of network devices (routers, firewalls etc.) and writes the corresponding PowerDNS resource records.

[![Go Report Card](https://goreportcard.com/badge/github.com/joeig/dyndns-pdns)](https://goreportcard.com/report/github.com/joeig/dyndns-pdns)

## Setup

### Install from source

You need `go` and `GOBIN` in your `PATH`. Once that is done, install dyndns-pdns using the following command:

~~~ bash
go install github.com/joeig/dyndns-pdns/cmd/dyndns-pdns@latest
~~~

After that, copy [`config.dist.yml`](configs/config.dist.yml) to `config.yml`, replace the default settings and run the binary:

~~~ bash
dyndns-pdns -config=/path/to/config.yml
~~~

If you're intending to add the application to your systemd runlevel, you may want to take a look at [`init/dyndns-pdns.service`](init/dyndns-pdns.service).

## Usage

### Update IP addresses of a certain host

In order to update the IP address of a certain host, you can choose between to ingest modes:

- Use the value provided by a HTTP GET parameter (IPv4 and/or IPv6)
- Use the value provided by the TCP remote address field (either IPv4 or IPv6, depending on the client's capabilities)

This tool does not support the DDNS protocol (RFC2136), which is supported by PowerDNS out of the box.

#### HTTP GET parameter

Suitable for all common network devices.

~~~ bash
http "https://dyn-ingest.example.com/v1/host//sync?key=&ipv4=&ipv6="
~~~

You have to provide at least one IP address family.

#### TCP remote address

If your router doesn't know its own egress IP address (might be the most promising solution for people that have to work behind NAT gateways or proxies).

~~~ bash
http "https://dyn-ingest.example.com/v1/host//sync?key="
~~~

This option takes the IP address (IPv4 or IPv6) used by the client during the TCP handshake.

### Comment regarding the update process

The PowerDNS API is not transaction safe. Existing resource record entries, which belong to a specific host, are dropped, before the new IP addresses are inserted for that host. Due to potential delays between the "delete" step and the "add" step, there is a risk that the dynamic DNS hostname might become unavailable. In order to lower the impact caused by this behaviour, it is recommended to set your negative caching TTL to a low value.

## Examples

### Fritzbox (FritzOS)

Your Fritzbox configuration might look like this:

| Key | Value |
| --- | ----- |
| Provider | Custom |
| Update URL | https://dyn-ingest.example.com/v1/host/\/sync?key=\&ipv4=\&ipv6=\ |
| Domain name | fb-home.dyn.example.com |
| Username | fb-home |
| Password | my secret password |

You have to copy the update URL as it is, including all the placeholders and \<\> brackets. They will be substituted by FritzOS internally with the corresponding values.

The key table item should be as following:

~~~ yaml
keyTable:
- name: "fb-home"
enable: true
key: "my secret password"
hostName: "fb-home"
ingestMode: "getParameter"
~~~