kutzilla / docker-hetzner-ddns

A Docker image that allows you to use Hetzner DNS as a DynDNS Provider
MIT License
23 stars 8 forks source link

TTL value owerwritten #10

Open punqbund opened 2 years ago

punqbund commented 2 years ago

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>
kutzilla commented 2 years ago

The DDNS sets the TTL value to 0. I agree with you that it should use the default TTL value. Im going to add an environment variable to set it manually. If not set, it uses the default value of Hetzner. Therefore it shouldn't effect the zonefile. What do you think about that?

punqbund commented 2 years ago

This sounds good. If the environment variable with appropriate value is provided, it should set it, if the user does not set the environment variable, the TTL should not be set at all.

kutzilla commented 2 years ago

The environment variable is now included in v2.0

kutzilla commented 2 years ago

Nevermind. I got to fix it. I'm going to respond if it's working

kutzilla commented 2 years ago

Could you try it again? Just put out version 2.1, which includes a new implementation to read the provided config. Now the TTL value should be factored in.

punqbund commented 2 years ago

@kutzilla I tested it today. Now, if no ttl value provided, the default value will be written into the zone file: @ 86400 IN A xxx.xxx.xxx.xxx

It is a working solution. But actually I would expect that it would not set the ttl value, if not provided, and and the result would be like @ IN A xxx.xxx.xxx.xxx