A Docker image that allows you to use Hetzner DNS as a DynDNS Provider

Build Status Docker Pulls

Docker Hetzner DDNS

This Docker image will allow you to use the Hetzner DNS Service as a Dynamic DNS Provider (DDNS).

How does it work?

The Go script inside this Docker Image periodically checks the DNS record with the Hetzner DNS API. It also checks the current public IP of the network, the container is running on. If the DNS record does not match the current public IP, it will update the record. Therefore your DNS record updates dynamically to the public IP.

Usage

Quick Setup:

docker run \
-e ZONE_NAME=example.com \ 
-e HETZNER_API_TOKEN=my-secret-api-token \
-e ZONE_RECORD_TYPE=A \
kutzilla/hetzner-ddns

If you prefer command-line arguments, you can use this command:

docker run kutzilla/hetzner-ddns example.com my-secret-api-token A

Parameters

  • -e ZONE_NAME - The DNS zone that DDNS updates should be applied to. Required
  • -e API_TOKEN - Your Hetzner API token. Required
  • -e RECORD_TYPE - The record type of your zone. If your zone uses an IPv4 address use A. Use AAAA if it uses an IPv6 address. Required
  • --restart=always - ensure the container restarts automatically after host reboot.

Optional Parameters

  • -e RECORD_NAME - The name of the DNS-record that DDNS updates should be applied to. This could be sub if you like to update the subdomain sub.example.com of example.com. The default value is @.
  • -e CRON_EXPRESSION - The cron expression of the DDNS update interval. The default is every 5 minutes - */5 * * * *.

Build

Build the latest version of the Docker image with the following command:

docker build kutzilla/hetzner-ddns .
Owner
Matthias Kutz
IT-Consultant @viadee. Interested in Software and Web Engineering, Data Science and Artificial Intelligence.
Matthias Kutz
Comments
  • Would be nice if DnsRecordName can be set by a parameter

    Would be nice if DnsRecordName can be set by a parameter

    I only want to point a sub domain to my dynamic ip at home. Therefor it would be nice if DnsRecordName can also be set by a parameter.

    Other then that nice work and thanks for sharing it :-)

  • Bump github.com/stretchr/testify from 1.7.1 to 1.7.5

    Bump github.com/stretchr/testify from 1.7.1 to 1.7.5

    Bumps github.com/stretchr/testify from 1.7.1 to 1.7.5.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Bump github.com/stretchr/testify from 1.7.1 to 1.7.4

    Bump github.com/stretchr/testify from 1.7.1 to 1.7.4

    Bumps github.com/stretchr/testify from 1.7.1 to 1.7.4.

    Commits
    • 48391ba Fix panic in AssertExpectations for mocks without expectations (#1207)
    • 840cb80 arrays value types in a zero-initialized state are considered empty (#1126)
    • 07dc7ee Bump actions/setup-go from 3.1.0 to 3.2.0 (#1191)
    • c33fc8d Bump actions/checkout from 2 to 3 (#1163)
    • 3c33e07 Added Go 1.18.1 as a build/supported version (#1182)
    • e2b56b3 Bump github.com/stretchr/objx from 0.1.0 to 0.4.0
    • 41453c0 Update gopkg.in/yaml.v3
    • 285adcc Update go versions in build matrix
    • 6e7fab4 Bump actions/setup-go from 2 to 3.1.0
    • 106ec21 use RWMutex
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Bump github.com/stretchr/testify from 1.7.1 to 1.7.2

    Bump github.com/stretchr/testify from 1.7.1 to 1.7.2

    Bumps github.com/stretchr/testify from 1.7.1 to 1.7.2.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Use advanced Go features

    Use advanced Go features

    The codebase has a pretty imperative and less fault-tolerant implementation. It should be enhanced by using more advanced features like structs and error handling.

  • Restructure the code base

    Restructure the code base

    To improve the code quality the package structure should be improved. The structure could be based on https://github.com/golang-standards/project-layout.

  • Add test structure and unit tests

    Add test structure and unit tests

    To improve the development workflow unit tests should be added. These tests should validate the present functionality and make new functionality possible, without interfering the present one.

  • Use ipify instead of IPInfo to determine the public IP

    Use ipify instead of IPInfo to determine the public IP

    The amount of requests to the https://ipinfo.io is limited. To be able to update the public IP frequently, we should switch to https://ipify.org, because the request amount is not limited.

  • Use a cron job for scheduling

    Use a cron job for scheduling

    The current implementation uses an infinite-loop and time.Sleep for updating the DNS record. This should be improved by using a proper scheduling solution like cron jobs.

  • Bump github.com/stretchr/testify from 1.7.1 to 1.8.0

    Bump github.com/stretchr/testify from 1.7.1 to 1.8.0

    Bumps github.com/stretchr/testify from 1.7.1 to 1.8.0.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Bump github.com/stretchr/testify from 1.7.1 to 1.7.2

    Bump github.com/stretchr/testify from 1.7.1 to 1.7.2

    Bumps github.com/stretchr/testify from 1.7.1 to 1.7.2.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Update Multiple Record Names

    Update Multiple Record Names

    Hi, I am using your Script on my Unraid Server at Home and it Works great, but I am wondering if its possible to update more than one Record Name? Maybe its possible to add more Record Names and seperate them with commas, but I dont find any Documentation for that. The other solution would be to run a second docker container for a second Record Name.

  • No connection to ip provider

    No connection to ip provider

    Hey,

    i have setup the docker client for this with my zone/token and record id.

    Used Setup is unraid + docker + hetzner dns console api token. i am trying to update a subdomain to my current ip address.

    after starting the container it claims "No connection to ip provider", what provider and return value is used, and is it possible to adjust the url?

    At the moment the client is not working without it.

    Best regards Kantm

  • Bump github.com/stretchr/testify from 1.8.0 to 1.8.1

    Bump github.com/stretchr/testify from 1.8.0 to 1.8.1

    Bumps github.com/stretchr/testify from 1.8.0 to 1.8.1.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • IPv6 update seems not to work

    IPv6 update seems not to work

    Hi, i'm running ipv4 and a ipv6 docker container for updates of my domain.

    • IPv4 is doing fine with the subdomain
    • IPv6 is not updated

    docker run -e ZONE_NAME=mydomain.de -e API_TOKEN=<hetzner_api_token> -e RECORD_TYPE=AAAA -e RECORD_NAME=dyn kutzilla/hetzner-ddns

    Output is like:

    Requesting zone: mydomain.de Started DynDNS

    Current public IP is: 37.209.121.234 DNS update required for dyn.mydomain.de with IP 2a02:8070:a85:e900::5a3 Updated DNS for dyn.mydomain.de from IP 2a02:8070:a85:e900::5a3 to IP

    Current public IP is: 37.209.121.234 DNS update required for dyn.mydomain.de with IP 2a02:8070:a85:e900::5a3 Updated DNS for dyn.mydomain.de from IP 2a02:8070:a85:e900::5a3 to IP

    The ipv6 listed is the one at my zonefile, Current public IP is my IPv4 not the IPv6 and the update fails.

    on the same host i'm doing IPv6 updates with ddclient without problems to another dyn dns Hoster but i want to change complete to Hetzner if ipv6 will work.

  • TTL value owerwritten

    TTL value owerwritten

    After the DDNS update, the TTL value was set to 0, regardless of the default TTL value.

    Zonefile entry before DDNS update:

    ; A Records
    <my record>		IN	A	<my ip address>
    

    After DDNS update:

    ; A Records
    <my record>	0	IN	A	<my ip address>
    
Terraform module to provisison Kubernetes Clusters on Hetzner cloud (Based on KubeOne)

Terraform module template Terraform module which creates describe your intent resources on AWS. Usage Use this template to scaffold a new terraform mo

Nov 26, 2021
ecsk is a CLI tool to interactively use frequently used functions of docker command in Amazon ECS. (docker run, exec, cp, logs, stop)
ecsk is a CLI tool to interactively use frequently used functions of docker command in Amazon ECS. (docker run, exec, cp, logs, stop)

English / 日本語 ecsk ECS + Task = ecsk ?? ecsk is a CLI tool to interactively use frequently used functions of docker command in Amazon ECS. (docker run

Dec 13, 2022
Fleex allows you to create multiple VPS on cloud providers and use them to distribute your workload.
Fleex allows you to create multiple VPS on cloud providers and use them to distribute your workload.

Fleex allows you to create multiple VPS on cloud providers and use them to distribute your workload. Run tools like masscan, puredns, ffuf, httpx or a

Dec 31, 2022
The Container Storage Interface (CSI) Driver for Fortress Block Storage This driver allows you to use Fortress Block Storage with your container orchestrator

fortress-csi The Container Storage Interface (CSI) Driver for Fortress Block Storage This driver allows you to use Fortress Block Storage with your co

Jan 23, 2022
Custom Terraform provider that allows provisioning VGS Proxy Routes.

VGS Terraform Provider Custom Terraform provider that allows provisioning VGS Proxy Routes. How to Install Requirements: terraform ver 0.12 or later M

Mar 12, 2022
terraform-provider-jwk allows to generate jwk documents using a public_key

Terraform-provider-jwk A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) datastructure that represents a cryptographic key, these public key

Mar 18, 2022
OpenAPI Terraform Provider that configures itself at runtime with the resources exposed by the service provider (defined in a swagger file)
OpenAPI Terraform Provider that configures itself at runtime with the resources exposed by the service provider (defined in a swagger file)

Terraform Provider OpenAPI This terraform provider aims to minimise as much as possible the efforts needed from service providers to create and mainta

Dec 26, 2022
Terraform provider to help with various AWS automation tasks (mostly all that stuff we cannot accomplish with the official AWS terraform provider)
Terraform provider to help with various AWS automation tasks (mostly all that stuff we cannot accomplish with the official AWS terraform provider)

terraform-provider-awsutils Terraform provider for performing various tasks that cannot be performed with the official AWS Terraform Provider from Has

Dec 8, 2022
Terraform Provider for Azure (Resource Manager)Terraform Provider for Azure (Resource Manager)
Terraform Provider for Azure (Resource Manager)Terraform Provider for Azure (Resource Manager)

Terraform Provider for Azure (Resource Manager) Version 2.x of the AzureRM Provider requires Terraform 0.12.x and later, but 1.0 is recommended. Terra

Oct 16, 2021
provider-kubernetes is a Crossplane Provider that enables deployment and management of arbitrary Kubernetes objects on clusters

provider-kubernetes provider-kubernetes is a Crossplane Provider that enables deployment and management of arbitrary Kubernetes objects on clusters ty

Dec 14, 2022
Terraform-provider-mailcow - Terraform provider for Mailcow

Terraform Provider Scaffolding (Terraform Plugin SDK) This template repository i

Dec 31, 2021
Provider-generic-workflows - A generic provider which uses argo workflows to define the backend actions.

provider-generic-workflows provider-generic-workflows is a generic provider which uses argo workflows for managing the external resource. This will re

Jan 1, 2022
Terraform-provider-buddy - Terraform Buddy provider For golang

Terraform Provider for Buddy Documentation Requirements Terraform >= 1.0.11 Go >

Jan 5, 2022
Hashicups-tf-provider - HashiCups Terraform Provider Tutorial

Terraform Provider HashiCups Run the following command to build the provider go

Jan 10, 2022
Terraform-provider-vercel - Terraform Vercel Provider With Golang

Vercel Terraform Provider Website: https://www.terraform.io Documentation: https

Dec 14, 2022
Provider-milvus - Milvus provider for crossplane

provider-milvus provider-milvus is a minimal Crossplane Provider that is meant t

Feb 9, 2022
Terraform-provider-age - Age Terraform Provider with golang

Age Terraform Provider This provider lets you generate an Age key pair. Using th

Feb 15, 2022
Terraform-equinix-migration-tool - Tool to migrate code from Equinix Metal terraform provider to Equinix terraform provider

Equinix Terraform Provider Migration Tool This tool targets a terraform working

Feb 15, 2022
k8s-image-swapper Mirror images into your own registry and swap image references automatically.
k8s-image-swapper Mirror images into your own registry and swap image references automatically.

k8s-image-swapper Mirror images into your own registry and swap image references automatically. k8s-image-swapper is a mutating webhook for Kubernetes

Dec 27, 2022