diff --git a/modules/dns/hetzner.tf b/modules/dns/hetzner.tf index 06638b8..fd3db29 100644 --- a/modules/dns/hetzner.tf +++ b/modules/dns/hetzner.tf @@ -3,6 +3,14 @@ resource "hetznerdns_zone" "monotremata_xyz" { ttl = 86400 } +resource "hetznerdns_record" "caladan_a_root" { + zone_id = hetznerdns_zone.monotremata_xyz.id + name = "@" + value = var.caladan.ipv4 + type = "A" + ttl = 86400 +} + resource "hetznerdns_record" "caladan_a" { zone_id = hetznerdns_zone.monotremata_xyz.id name = each.key @@ -12,6 +20,14 @@ resource "hetznerdns_record" "caladan_a" { for_each = var.caladan.domains } +resource "hetznerdns_record" "caladan_aAAA_root" { + zone_id = hetznerdns_zone.monotremata_xyz.id + name = "@" + value = var.caladan.ipv6 + type = "AAAA" + ttl = 86400 +} + resource "hetznerdns_record" "caladan_aaaa" { zone_id = hetznerdns_zone.monotremata_xyz.id name = each.key diff --git a/modules/dns/linode.tf b/modules/dns/linode.tf index f6c9065..fa42ed1 100644 --- a/modules/dns/linode.tf +++ b/modules/dns/linode.tf @@ -9,6 +9,12 @@ resource "linode_domain" "monotremata_xyz" { soa_email = format("admin@%s", var.domain) } +resource "linode_domain_record" "caladan_a_root" { + domain_id = linode_domain.monotremata_xyz.id + record_type = "A" + target = var.caladan.ipv4 +} + resource "linode_domain_record" "caladan_a" { domain_id = linode_domain.monotremata_xyz.id name = each.key @@ -17,6 +23,12 @@ resource "linode_domain_record" "caladan_a" { for_each = var.caladan.domains } +resource "linode_domain_record" "caladan_aaaa_root" { + domain_id = linode_domain.monotremata_xyz.id + record_type = "AAAA" + target = var.caladan.ipv6 +} + resource "linode_domain_record" "caladan_aaaa" { domain_id = linode_domain.monotremata_xyz.id name = each.key @@ -43,7 +55,7 @@ resource "linode_domain_record" "mx" { priority = null } MX = { - name = var.domain, + name = null target = format("mail.%s", var.domain) priority = 0 } @@ -68,7 +80,7 @@ resource "linode_domain_record" "mx2" { priority = null } MX = { - name = var.domain + name = null target = format("mx2.%s", var.domain) priority = 5 } @@ -82,7 +94,7 @@ resource "linode_domain_record" "mail_txt" { target = each.value.target for_each = { spf = { - name = var.domain + name = null target = "v=spf1 mx -all" } dmarc = {