- Go 93.4%
- Shell 4.2%
- Makefile 2.4%
|
|
||
|---|---|---|
| .forgejo | ||
| .vscode | ||
| cmd | ||
| internal/server | ||
| .devcontainer.json | ||
| .gitignore | ||
| AGENTS.md | ||
| CHANGELOG.md | ||
| go.mod | ||
| go.sum | ||
| install.sh | ||
| LICENSE | ||
| main.go | ||
| Makefile | ||
| README.md | ||
| renovate.json | ||
hostsharing-dyndns
A DynDNS service for Hostsharing e.G., tested with Fritz!Box routers but compatible with any DynDNS client. The service runs as a FastCGI application under Apache and is started automatically - no manual server startup is required.
Overview
This service enables dynamic DNS updates for domains hosted on the Managed Operations Platform. It is tested with Fritz!Box routers but works with any client that supports standard DynDNS update requests.
The application runs as a FastCGI binary under Apache. The Managed Operations Platform automatically starts the service when requests are received at the configured URL.
For more information about FastCGI on the Managed Operations Platform, see the official documentation.
For support or questions, you can also contact the author via contact page.
Features
- IPv4 and IPv6 support - Handles both address families for complete DNS coverage
- Secure authentication - Uses Argon2id password hashing (plaintext passwords are never stored)
- Automatic zonefile generation - Creates and updates DNS zone files automatically
- Sensible defaults - Minimal configuration required for standard setups
Prerequisites
- A Web Hosting Package on the Managed Operations Platform with FastCGI access
- A DynDNS-compatible client (tested with Fritz!Box)
Installation
One-line install
SSH into your Hostsharing server, change into the FastCGI folder of the domain you want to serve the DynDNS endpoint from, then run:
cd ~/doms/dyndns.example.com/fastcgi-ssl
curl -fsSL https://forge.sebatec.eu/sebatec-eu/hostsharing-dyndns/raw/branch/main/install.sh | bash
The binary lands in the current directory, already executable. Apache's FastCGI wiring picks it up automatically.
Substitute dyndns.example.com with the actual domain whose doms/
directory you want to use.
Build the binary
make build
This creates a statically linked binary named hostsharing-dyndns in the current directory.
Deploy to Hostsharing
Set your SSH host and destination path in Makefile.variables:
SSH_HOST=your-hostsharing-server
SCP_DEST=doms/dyndns.example.com/fastcgi-ssl/
Then deploy:
make deploy
This copies the binary to doms/dyndns.example.com/fastcgi-ssl/hostsharing-dyndns on the Managed Operations Platform, where it will be accessible at:
https://dyndns.example.com/fastcgi-bin/hostsharing-dyndns
Usage
Configure Fritz!Box
In your Fritz!Box DynDNS configuration, use this URL format:
https://dyndns.example.com/fastcgi-bin/hostsharing-dyndns?user=home&passwd=<password>&ipaddr=<ipv4>&ip6addr=<ipv6>
Replace <password> with the base64-RawURL encoded password generated by the generatePassword command (see below). The user parameter defaults to home if not specified.
For Fritz!Box configuration instructions, see the official AVM documentation.
Generate a password
Generate a secure password and configuration block:
hostsharing-dyndns generatePassword
This outputs two parts:
- A YAML configuration block for your config file (contains the Argon2id hash and salt)
- The base64-RawURL encoded password to use in your Fritz!Box URL
Important: The plaintext password is never stored. Only the Argon2id hash (Key) and Salt are saved in the configuration file.
Validate configuration
Check your configuration file for errors:
hostsharing-dyndns validateConfig
Configuration
The service requires a YAML configuration file located at:
~/doms/dyndns.example.com/etc/hostsharing-dyndns/config
Create the directory and file:
mkdir -p ~/doms/dyndns.example.com/etc/hostsharing-dyndns
vim ~/doms/dyndns.example.com/etc/hostsharing-dyndns/config
Minimal configuration
Only the Password block is required. All other fields use sensible defaults:
UpdaterHandler:
Password:
Key: <base64-RawURL>
Salt: <base64-RawURL>
Time: 8
Memory: 65536
Threads: 4
KeyLen: 32
Use the output from hostsharing-dyndns generatePassword for the Password block values.
Full configuration with defaults
All available configuration options with their default values:
UpdaterHandler:
User: home
DomainSubpart: home
Filename: ~/doms/dyndns.example.com/etc/pri.dyndns.example.com
Password:
Key: <base64-RawURL>
Salt: <base64-RawURL>
Time: 8
Memory: 65536
Threads: 4
KeyLen: 32
Logger:
Enabled: true
| Field | Default | Description |
|---|---|---|
User |
home |
Username for authentication |
DomainSubpart |
Same as User |
Subdomain part for the DNS record |
Filename |
Derived from FCGI path | Path to the generated zonefile |
Logger.Enabled |
true |
Enable request logging |
Local development
For local testing without FastCGI, set the configuration base path:
CONFIG_BASE_PATH=/home/pacs/<pac>/users/<user>/doms/dyndns.example.com/svc \
./hostsharing-dyndns validateConfig
Troubleshooting
403 Forbidden
Verify that:
- The
userparameter in your URL matches the configuredUser(default:home) - The
passwdparameter is the correct base64-RawURL encoded password - The binary is deployed to the correct FastCGI directory
Configuration errors
Use hostsharing-dyndns validateConfig to check your configuration file for syntax errors or missing required fields.
IP address errors
Ensure that:
ipaddrcontains a valid IPv4 address (if provided)ip6addrcontains a valid IPv6 address (if provided)