Categorygithub.com/davidborzek/hetzner-ddns-updater
repositorypackage
0.2.2
Repository: https://github.com/davidborzek/hetzner-ddns-updater.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# README

Build and publish docker image Tests Go Report Card

hetzner-ddns-updater

hetzner-ddns-updater is a lightweight service designed to periodically check for changes in your external IP address and update a DNS record at Hetzner when necessary. This project simplifies the process of keeping your DNS records up-to-date with your dynamic IP address.

Table of Contents

Configuration

To configure hetzner-ddns-updater, you can use environment variables. Here are the available configuration parameters:

Environment VariableDefault ValueDescription
HDU_ADDRESS:8080The address and port on which the service will listen.
HDU_API_TOKENRequiredYour Hetzner API token for authentication.
HDU_RECORD_IDRequiredThe ID of the DNS record to be updated.
HDU_ZONE_IDRequiredThe ID of the DNS zone where the record resides.
HDU_RECORD_NAME@The DNS record name to be updated (e.g., subdomain).
HDU_RECORD_TTL60Time to live (TTL) for the DNS record in seconds.
HDU_INTERVAL5mThe interval at which the service checks for IP address changes.
HDU_METRICS_ENABLEDfalseEnable or disable Prometheus metrics.
HDU_METRICS_TOKENToken to secure access to Prometheus metrics when enabled.
HDU_PUBLIC_IP_PROVIDERhttps://api.ipify.org?format=textThe api url to a route that returns your public ip as plain text.

Metrics

When Prometheus metrics are enabled (HDU_METRICS_ENABLED=true), the service exposes the following metrics in Prometheus format at the /metrics route:

NameTypeDescription
hdu_total_updatesCounterNumber of ddns updates
hdu_failed_updatesCounterNumber of failed ddns updates

These metrics provide insights into the update activity of the service, helping you monitor its performance and reliability.

Running with Docker

You can easily run hetzner-ddns-updater as a Docker container. Here's an example command to start the service:

docker run -d \
     -e "HDU_API_TOKEN=<your_hetzner_api_token>" \
     -e "HDU_RECORD_ID=<your_record_id>" \
     -e "HDU_ZONE_ID=<your_zone_id>" \
     -p 8080:8080 \
     ghcr.io/davidborzek/hetzner-ddns-updater:latest