Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use default zone TTL #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Use default zone TTL #3

wants to merge 2 commits into from

Conversation

lus
Copy link

@lus lus commented Jun 5, 2022

The Hetzner DNS API returns a default TTL field for every zone.
Based on this, records that use a non-custom TTL will not include the ttl field at all in their JSON representation and thus result in a libdns.Record object with a TTL of 0 seconds.

This PR solves this by enhancing the existent getZoneID (renamed to getZoneData) to not only return the zone's ID but also its default TTL.
It also updates the unmarshalling step of a JSON record returned by the Hetzner API to use this default TTL when the ttl field does not exist.

@mholt
Copy link

mholt commented Jun 7, 2022

@matthiasng Could you take a look at this please? 😃

@mholt mholt requested a review from matthiasng June 7, 2022 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants