https://github.com/lightlike/netcup-dyndns-docker
A Netcup dyndns updater run in docker
https://github.com/lightlike/netcup-dyndns-docker
ansible dns docker netcup
Last synced: 11 months ago
JSON representation
A Netcup dyndns updater run in docker
- Host: GitHub
- URL: https://github.com/lightlike/netcup-dyndns-docker
- Owner: lightlike
- License: mit
- Created: 2024-06-16T09:03:23.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-28T21:26:46.000Z (12 months ago)
- Last Synced: 2025-01-28T22:26:14.395Z (12 months ago)
- Topics: ansible, dns, docker, netcup
- Language: Dockerfile
- Homepage:
- Size: 27.3 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Netcup DynDNS API Job using Ansible
[](https://github.com/lightlike/netcup-dyndns-docker/releases/latest)
[](https://github.com/lightlike/netcup-dyndns-docker/actions/workflows/docker-publish.yml)
## Summary
This container uses cron and ansible to periodically set dns entries for the current device.
> This is meant to be a (mostly) drop-in replacement for [b2un0/docker-netcup-dyndns](https://github.com/b2un0/docker-netcup-dyndns)
> You should just need to change the value for `MODE` from `both` to `@ *`.
This in itself does the same as the original but come with the folling improvements:
- fallback identity server when the original is down
- creates the domain entries automatically
- can set other subdomains than just `@` and `*`
## Setup
### Docker
```yaml
version: '2'
services:
netcup-dyndns:
container_name: netcup-dyndns
environment:
SCHEDULE: "*/10 * * * *"
DOMAIN: "example.com"
MODE: "@ *"
IPv4: "yes"
IPv6: "yes"
CUSTOMER_ID: ${CUSTOMER_ID}
API_KEY: ${API_KEY}
API_PASSWORD: ${API_PASSWORD}
TZ: "Europe/Berlin"
restart: unless-stopped
image: ghcr.io/lightlike/netcup-dyndns:latest
```
### Without Docker
This container only executes the ansible playbook as a cronjob.
Any dependencies can be found inside the `Dockerfile` so this can be executed without the container.
This is not supported and you have to know how to work with ansible.
## Variables
| Variable | Function |
|:------------:|:-------- |
| SCHEDULE | Cron schedule for executing ansible playbook
default: every 10 minutes
time between executions can be reduced but try not to reduce it to much.
| DOMAIN | The domain the values should be set to
| MODE | Subdomains the IPs should be set to (separated by space)
default: `@` and `*`
| IPv4 | if IPv4 should be set
default: no
| IPv6 | if IPv6 should be set
default: no
| CUSTOMER_ID | netcup customer id
| API_KEY | netcup API key
| API_PASSWORD | netcup API password
## Funtionality
This container uses http://ident.me/ and http://tnedi.me/ to get the current IP of the Server and sets that as in netcup.
The Documentation for these sites can be found under: https://api.ident.me/ and https://api.tnedi.me/
These Websites are located in Germany if that may couse trouble for you.
### IPv6
Docker by default does not support outgoing requests using IPv6.
This can be enabled by following this guide: https://docs.docker.com/config/daemon/ipv6/
If you do not need IPv6 for anything else, you can also just set:
```yaml
version: '2'
services:
netcup-dyndns:
container_name: netcup-dyndns
network_mode: "host"
environment:
...
restart: unless-stopped
image: ghcr.io/lightlike/netcup-dyndns:latest
```
That should not cause any problems as this container does not expose any ports.
### Replacing the current logic
The current ansible logic can be replaced by replacing the `update-dns.yaml`.
This can be done by mounting a new file from the host system to the container.
```yaml
version: '2'
services:
netcup-dyndns:
container_name: netcup-dyndns
environment:
...
volumes:
- /path/to/new/yaml:/netcup-dns/ansible/update-dns.yaml:ro
restart: unless-stopped
image: ghcr.io/lightlike/netcup-dyndns:latest
```