2023-07-13 16:37:14 +00:00
resource " hetznerdns_zone " " server " {
2023-07-17 08:31:59 +00:00
name = var . dns_zone
2023-07-13 16:37:14 +00:00
ttl = 3600
}
2023-07-05 10:52:45 +00:00
2024-06-06 12:46:47 +00:00
resource " hetznerdns_record " " root_a " {
zone_id = hetznerdns_zone . server . id
name = " @ "
type = " A "
value = var . ipv4_address
}
resource " hetznerdns_record " " root_aaaa " {
zone_id = hetznerdns_zone . server . id
name = " @ "
type = " AAAA "
value = var . ipv6_address
}
resource " hetznerdns_record " " wildcard_a " {
2023-07-13 16:37:14 +00:00
zone_id = hetznerdns_zone . server . id
2024-06-06 12:46:47 +00:00
name = " * "
2023-07-13 16:37:14 +00:00
type = " A "
2023-07-17 08:31:59 +00:00
value = var . ipv4_address
2023-07-13 16:37:14 +00:00
}
2024-06-06 12:46:47 +00:00
resource " hetznerdns_record " " wildcard_aaaa " {
2023-07-13 16:37:14 +00:00
zone_id = hetznerdns_zone . server . id
2024-06-06 12:46:47 +00:00
name = " * "
2023-07-13 16:37:14 +00:00
type = " AAAA "
2023-07-17 08:31:59 +00:00
value = var . ipv6_address
2023-07-13 16:37:14 +00:00
}
2023-07-05 10:52:45 +00:00
# for sending emails
2023-07-13 16:37:14 +00:00
resource " hetznerdns_record " " spf " {
zone_id = hetznerdns_zone . server . id
name = " @ "
type = " TXT "
2023-07-17 08:31:59 +00:00
value = " \ " v =spf1 ip4 : $ { var . ipv4_address } ip6 : $ { var . ipv6_address } ~ all \ " "
2023-07-13 16:37:14 +00:00
}
resource " hetznerdns_record " " dkim " {
zone_id = hetznerdns_zone . server . id
2023-07-17 08:31:59 +00:00
name = " v1._hostnamekey "
2023-07-13 16:37:14 +00:00
type = " TXT "
# take from `systemctl status opendkim`
2023-07-17 08:31:59 +00:00
value = " \ " v =DKIM1 ; k =rsa ; p =MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDpQeJirqh8VFGHRQBemqF5CeicC / 5 qHJn3vqKkVIOQNqkgp7IE + EZDg + MXoxMQZEJ0RbO0JpZZgYpOf3jf8o5w56WbE4dbpbi + 9112 R57k5w41R16Q0EUjf7MbrLJqcF6mtf + 3 bPklF9ngdcWhgN024YfhR9SlebCOapCVYqVt8QIDAQAB \ " "
2023-07-13 16:37:14 +00:00
}
resource " hetznerdns_record " " adsp " {
zone_id = hetznerdns_zone . server . id
2023-07-17 08:31:59 +00:00
name = " _adsp._hostnamekey "
2023-07-13 16:37:14 +00:00
type = " TXT "
value = " \ " dkim =all ; \ " "
2023-07-13 16:41:09 +00:00
}
resource " hetznerdns_record " " matrix " {
zone_id = hetznerdns_zone . server . id
name = " _matrix._tcp "
type = " SRV "
value = " 0 5 443 matrix "
2023-07-13 16:37:14 +00:00
}
resource " hetznerdns_record " " dmarc " {
zone_id = hetznerdns_zone . server . id
name = " _dmarc "
type = " TXT "
value = " \ " v =DMARC1 ; p =none ; adkim =r ; aspf =r ; rua =mailto : joerc . dmarc @ thalheim . io ; ruf =mailto : joerg . dmarc @ thalheim . io ; pct =100 \ " "
}