| page_title | hetznerdns Provider |
|---|---|
| description | This providers helps you automate management of DNS zones and records at Hetzner DNS. WARNING: This provider is deprecated as of 10 Nov 2025 with the release of the hcloud Console DNS, please migrate to the official Hetzner hcloud provider |
This providers helps you automate management of DNS zones and records at Hetzner DNS. WARNING: This provider is deprecated as of 10 Nov 2025 with the release of the hcloud Console DNS, please migrate to the official Hetzner hcloud provider
provider "hetznerdns" {
api_token = ""
}
data "hetznerdns_zone" "dns_zone" {
name = "example.com"
}
data "hcloud_server" "web" {
name = "web1"
}
resource "hetznerdns_record" "web" {
zone_id = data.hetznerdns_zone.dns_zone.id
name = "www"
value = hcloud_server.web.ipv4_address
type = "A"
ttl = 60
}api_token(String, Sensitive) The Hetzner DNS API token. You can pass it using the env variableHETZNER_DNS_TOKENas well. The old env variableHETZNER_DNS_API_TOKENis deprecated and will be removed in a future release.enable_ip_validation(Boolean)Default: trueToggles the validation of IP addresses in A and AAAA records. You can pass it using the env variableHETZNER_DNS_ENABLE_IP_VALIDATIONas well.enable_txt_formatter(Boolean)Default: trueToggles the automatic formatter for TXT record values. Values greater than 255 bytes get split into multiple quoted chunks (RFC4408). You can pass it using the env variableHETZNER_DNS_ENABLE_TXT_FORMATTERas well.max_retries(Number)Default: 1The maximum number of retries to perform when an API request fails. You can pass it using the env variableHETZNER_DNS_MAX_RETRIESas well.