There was an error while loading. Please reload this page.
How to manage DNS records with dynamic updates and terraform with your authoritative server.
Enable DNS update to your pdns.conf
dnsupdate=yes
Create a Tsig key and set metadata to your zone to authorize DNSUPDATE and AXFR with TSIG authentication.
TSIG-ALLOW-DNSUPDATE TSIG-ALLOW-AXFR
Create a main.tf file
Install the provider "dns" then, run terraform init.
terraform init
terraform { required_providers { dns = { source = "hashicorp/dns" version = "3.1.0" } } }
provider "dns" { update { server = "192.168.0.1" key_name = "example.com." key_algorithm = "hmac-md5" key_secret = "3VwZXJzZWNyZXQ=" } }
The following records can be managed from the provider terraform:
Example for A record:
resource "dns_a_record_set" "www" { zone = "example.com." name = "www" addresses = [ "192.168.0.1", "192.168.0.2", "192.168.0.3", ] ttl = 300 }
Run terraform destroy to delete it.
terraform destroy