forked from pablokbs/peladonerd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
04_dns.tf
65 lines (58 loc) · 1.26 KB
/
04_dns.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Creamos un dominio nuevo
# Add a record to the domain
resource "digitalocean_record" "mail" {
domain = var.domain
type = "A"
name = "mail"
ttl = "30"
value = digitalocean_droplet.mail.ipv4_address
}
# Add mx record to the domain (so it can receive emails)
resource "digitalocean_record" "mx" {
domain = var.domain
type = "MX"
name = "@"
priority = "10"
ttl = "14400"
value = "mail.${var.domain}."
}
# SPF
resource "digitalocean_record" "spf" {
domain = var.domain
type = "TXT"
name = "@"
ttl = "14400"
value = "v=spf1 mx ~all"
}
# DMARC
resource "digitalocean_record" "dmarc" {
domain = var.domain
type = "TXT"
name = "_dmarc.${var.domain}"
ttl = "14400"
value = "v=DMARC1; p=none; rua=mailto:dmarc-reports@${var.domain}"
}
# SMTP
resource "digitalocean_record" "smtp" {
domain = var.domain
type = "CNAME"
name = "smtp"
ttl = "14400"
value = "mail.${var.domain}."
}
# POP
resource "digitalocean_record" "pop" {
domain = var.domain
type = "CNAME"
name = "pop"
ttl = "14400"
value = "mail.${var.domain}."
}
# IMAP
resource "digitalocean_record" "imap" {
domain = var.domain
type = "CNAME"
name = "imap"
ttl = "14400"
value = "mail.${var.domain}."
}