148 lines
6.9 KiB
HCL
148 lines
6.9 KiB
HCL
# SOA record for vntx.net
|
|
resource "powerdns_record" "vntx_net_soa" {
|
|
depends_on = [powerdns_zone.vntx_net]
|
|
zone = "vntx.net."
|
|
name = "vntx.net."
|
|
type = "SOA"
|
|
ttl = 3600
|
|
records = ["ns1.as393837.net. graham.mcintire.me. 0 10800 3600 604800 3600"]
|
|
}
|
|
|
|
# Generate client IP records dynamically
|
|
locals {
|
|
# Subnets to create client records for
|
|
vntx_subnets = [188, 189, 190, 191]
|
|
|
|
# Generate all client IPs dynamically
|
|
client_ips = merge([
|
|
for subnet in local.vntx_subnets : {
|
|
for i in range(1, 255) : "${i}.${subnet}.client" => "204.110.${subnet}.${i}"
|
|
}
|
|
]...)
|
|
|
|
# Named hosts with specific IPs
|
|
named_hosts = {
|
|
"climax" = "204.110.188.62"
|
|
"core" = "10.254.254.253"
|
|
"culleoka" = "204.110.188.158"
|
|
"edge" = "204.110.191.190"
|
|
"librenms" = "204.110.191.227"
|
|
"logs" = "204.110.191.229"
|
|
"monitor" = "204.110.191.241"
|
|
"netbox" = "204.110.191.243"
|
|
"newhope" = "204.110.188.190"
|
|
"ns1" = "204.110.191.249"
|
|
"ns2" = "204.110.191.239"
|
|
"preseem" = "204.110.191.225"
|
|
"resolver-01" = "204.110.191.240"
|
|
"resolver-02" = "204.110.191.250"
|
|
"resolver1" = "204.110.191.240"
|
|
"resolver2" = "204.110.191.250"
|
|
"unimus" = "204.110.191.238"
|
|
"verona" = "204.110.188.254"
|
|
"@" = "198.185.159.144"
|
|
"routers" = "155.138.241.157"
|
|
"vpn" = "204.110.191.247"
|
|
"radius" = "204.110.191.248"
|
|
"speedtest" = "204.110.191.228"
|
|
"aprs" = "204.110.191.232"
|
|
"g2" = "204.110.191.221"
|
|
"net" = "104.238.146.79"
|
|
"uisp" = "204.110.191.224"
|
|
"dns" = "204.110.191.193"
|
|
}
|
|
|
|
# Merge client IPs and named hosts
|
|
all_a_records = merge(local.client_ips, local.named_hosts)
|
|
}
|
|
|
|
resource "powerdns_record" "vntx_a_records" {
|
|
for_each = local.all_a_records
|
|
|
|
depends_on = [powerdns_zone.vntx_net]
|
|
zone = "vntx.net."
|
|
name = each.key == "@" ? "vntx.net." : "${each.key}.vntx.net."
|
|
type = "A"
|
|
ttl = 3600
|
|
records = [each.value]
|
|
}
|
|
|
|
# Microsoft 365 MX record
|
|
resource "powerdns_record" "vntx_mx" {
|
|
depends_on = [powerdns_zone.vntx_net]
|
|
zone = "vntx.net."
|
|
name = "vntx.net."
|
|
type = "MX"
|
|
ttl = 3600
|
|
records = ["0 vntx-net.mail.protection.outlook.com."]
|
|
}
|
|
|
|
resource "powerdns_record" "vntx_txt_records" {
|
|
for_each = {
|
|
"_twilio" = "twilio-domain-verification=12bf63d61b86412618bdb4ab6c2b287a"
|
|
"_dmarc" = "v=DMARC1; p=none"
|
|
"_updown" = "updown-page=p/34yuc"
|
|
"_github-challenge-vntx" = "34ea2705e4"
|
|
"_github-pages-challenge-gmcintire" = "d125f4244edd0120ee0fa073d3acf1"
|
|
"krs._domainkey.mg" = "k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDHbWtJ5uPGEOPmJrT36WBXKxVL0b4fqjIM4n6oXK4zaUucqYp7jeoKG+FTO5XEjyja7hsP9WahntUrVb8WI5V6Cj0CznesMrM7oQRntcyuy8mSD1zilmZe4q2Kc65gj2MRrkg3tkJfogXHNz2rxmquNu/DxsFLeQP8a2E5tYXVFwIDAQAB"
|
|
"pic._domainkey.mg" = "k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDdv4ZUjhb9l0Nt1aEJMnH/TVNdVn9CEKkb8+RX3qBPMFGmJWrJ3BIFwOSTUBiPeCgd2vc4zOOv7iQhEgNTlIVNT/V1sY70Myo5t+tJCuJQT/G4h5D1u7LZB6YEOKTgd5wF5AoW/nLvKVEPyKl5mThB9KmIGqF5FMm9C9FWP8m6SQIDAQAB"
|
|
"s1._domainkey.mg" = "k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDI3w7b9bBNcWzSH8DspZbRNp+9G9pHbCfmHmr3r2JqXh+F8bFlCK6gJqEQW7SIJgYMmSJ5GlYyy4A3VxJJFcWLZb3dxMoWkGjrJ3gEUNQGmG6rnJ7eXJxKb5J2mGgEfQgCgkWXPFRmJhKXPWoZP3RqU2vJZ3t7vJxWHmv0bQPHKQIDAQAB"
|
|
"s2._domainkey.mg" = "k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDc3JXQvGMBl3cW+3N2OPLJwlP4cMvPp9yOQM9X1TLxJWX7Hd7m6rJ1Xf2T3PGP9ZDPfJGXh+PfGPYVJYP2JXGPfP9HPfP3GPfPHGPYVP9fPH+PfP+PfPHGPYVP9fPH+PfP+PfPHGPYVP9fPH+PfP+PfPHGPYVP9fPH+PfP+PfPHQIDAQAB"
|
|
"@" = "v=spf1 include:spf.protection.outlook.com include:mailgun.org -all"
|
|
}
|
|
|
|
depends_on = [powerdns_zone.vntx_net]
|
|
zone = "vntx.net."
|
|
name = each.key == "@" ? "vntx.net." : "${each.key}.vntx.net."
|
|
type = "TXT"
|
|
ttl = 3600
|
|
records = ["\"${each.value}\""]
|
|
}
|
|
|
|
resource "powerdns_record" "vntx_cname_records" {
|
|
for_each = {
|
|
# Current records
|
|
"mg" = "mailgun.org."
|
|
"email.mg" = "mailgun.org."
|
|
"*.w5isp" = "dokku.w5isp.com."
|
|
"mail.speedtest" = "mail.speedtest.vntx.net.s2.mailersendapp.com."
|
|
"status" = "stats.uptimerobot.com."
|
|
"ntp" = "0.us.pool.ntp.org."
|
|
"iptrack" = "dokku.w5isp.com."
|
|
|
|
"_4080c249b6e72dd04f2a9508aa1a1b7f.kivrak" = "_de3e5d511f3869bbd271b935a3b4f973.tljzshvwok.acm-validations.aws."
|
|
"_83337805c305955c6823504cc5e6ca29" = "_baf97cdcc7b6458fa5719e4261e9932f.sdgjtdhdhz.acm-validations.aws."
|
|
"_bc1077259b1fbbb11c1e16756e1883f9.irc" = "793f217a963b25f361ec1975e0fd7d54.dc2ec86a36550aed25a0011c0b2b044b.62f7abe714ec1.comodoca.com."
|
|
"177982" = "sendgrid.net."
|
|
"4809fce066c3da4d14197c7276ba083f.irc" = "b58bf151af520d34d8fad99d05274cb536893031.comodoca.com."
|
|
"9p83fpanfdgs8xdgcnzd" = "verify.squarespace.com."
|
|
"activate" = "verona-networks-checkout.gaiia-consumer.com."
|
|
"autodiscover.o365" = "autodiscover.outlook.com."
|
|
"autodiscover" = "autodiscover.outlook.com."
|
|
"em924886" = "return.smtp2go.net."
|
|
"em9279" = "u177982.wl233.sendgrid.net."
|
|
"email" = "mandrillapp.com."
|
|
"enterpriseenrollment.o365" = "enterpriseenrollment.manage.microsoft.com."
|
|
"enterpriseregistration.o365" = "enterpriseregistration.windows.net."
|
|
"link" = "track.smtp2go.net."
|
|
"lyncdiscover.o365" = "webdir.online.lync.com."
|
|
"mte1._domainkey" = "dkim1.mandrillapp.com."
|
|
"mte2._domainkey" = "dkim2.mandrillapp.com."
|
|
"portal" = "verona-networks-clientportal.gaiia-consumer.com."
|
|
"s1._domainkey" = "s1.domainkey.u177982.wl233.sendgrid.net."
|
|
"s2._domainkey" = "s2.domainkey.u177982.wl233.sendgrid.net."
|
|
"s924886._domainkey" = "dkim.smtp2go.net."
|
|
"sip.o365" = "sipdir.online.lync.com."
|
|
"uptime" = "page.updown.io."
|
|
"url62" = "sendgrid.net."
|
|
"url9812" = "sendgrid.net."
|
|
"www" = "ext-cust.squarespace.com."
|
|
}
|
|
|
|
depends_on = [powerdns_zone.vntx_net]
|
|
zone = "vntx.net."
|
|
name = "${each.key}.vntx.net."
|
|
type = "CNAME"
|
|
ttl = 3600
|
|
records = [each.value]
|
|
}
|