Dyndns client for the netcup DNS API written in go. Not related to netcup GmbH. It is heavily inspired by this project which might be also a good solution for your dynamic DNS needs.
- Multi domain support
- Subdomain support
- TTL update support
- Creation of a DNS record if it doesn't already exist
- Multi host support (nice when you need to update both
@and*) - IPv6 support
- Secure Docker support
- Secret files
If you need additional features please open up an Issue.
You need to create config.yml file in the same directory as the
docker-compose.yml file, take a look at config/example.yml
for an example. For a Docker setup do not save your secrets (api key, etc.)
directly in the config.yml, but rather as environment variable or secret file,
as shown below. For secrets management create three files under secrets/ with
the names customernr, apikey and apipassword. To further protect the
secrets from unauthorized access, make sure it is owned by the user that runs
dyndns-netcup-go, by default being the UID 62534 and make it read-only:
mkdir -p secrets/
sudo chown 62534:62534 secrets/*
sudo chmod 440 secrets/*After that setup you can use the docker-compose.yml as example.
docker run -d \
-v $(pwd)/config.yml:/config.yml \
-e INTERVAL=300 \
-e CUSTOMERNR=111111 \
-e APIKEY=my-fancy-api-key \
-e APIPASSWORD=my-fancy-api-pw \
ghcr.io/hentra/dyndns-netcup-go
This allows you to store the configuration in plain text(e.g. git) and inject the secrets safely from a secret management solution.
| Environment Variable | Description |
|---|---|
| INTERVAL | defines the interval of DNS updates in seconds |
| CUSTOMERNR_FILE | location of the secrets file containing your customer number from netcup |
| APIKEY_FILE | location of the secrets file containing your API key from netcup |
| APIPASSWORD_FILE | location of the secrets file containing your API password from netcu |
| CUSTOMERNR | alternative to secrets file: customer number from netcup |
| APIKEY | alternative to secrets file: containing your API key from netcup |
| APIPASSWORD | alternative to secrets file: containing your API password from netcu |
- Download the lastest binary for your OS
cdto the file you downloaded and unzip- Put
dyndns-netcup-gosomewhere in your path
First, install Go as recommended. After that run following commands:
git clone https://github.com/Hentra/dyndns-netcup-go.git
cd dyndns-netcup-go
go install
This will create a binary named dyndns-netcup-go and install it to your go
binary home. Make sure your GOPATH environment variable is set.
Refer to Usage for further information.
- You need to have a netcup account and a domain, obviously.
- Then you need an apikey and apipassword. Here is a description (in German) on how you get those.
- Move/rename the example configuration
config/example.ymltoconfig.ymland fill out all the fields. There are some comments in the file for further information. - Run
dyndns-netcup-go -vin the same directory as your configuration file and it will configure your DNS Records. You can specify the location of the configuration file with the-cor-configflag if you don't want to run it in the same directory. To disable the output for information remove the-vflag. You will still get the output from errors.
It might be necessary to run this program every few minutes. That interval depends on how you configured your TTL.
For a list of all available command line flags run dyndns-netcup-go -h.
Without the cache the application would lookup its ip addresses and fetch the DNS records from netcup. After that it will compare the specified hosts in the DNS records with the current ip addresses and update if necessary.
As reported in this issue it would be also possible to store the ip addresses between two runs of the application and only fetch DNS records from netcup when they differ.
To enable the cache configure the two variables IP-CACHE and
IP-CACHE-TIMEOUT as according to the comments in example.yml.
For any feature requests and or bugs open up an Issue. Feel free to also add a pull request and I will have a look on it.