aboutsummaryrefslogtreecommitdiffstats
path: root/roles/dns/templates/zones/aaronly.me.zone.j2
blob: b43b1ae36ef912aafd9dc0a11f7b07d1551fdcfb (plain)
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
; -*- mode: dns; -*-
; {{ ansible_managed }}
{% set hostmaster = "hostmaster." + network.domain %}
$ORIGIN     {{ domain }}.
$TTL        {{ dns.ttl }}

@           IN  SOA     {{ nameservers[0].ns[0] }}.  {{ hostmaster }}.  (
                        {{ domain | next_serial }}  ; serial number
                        {{ dns.refresh }}  ; refresh
                        {{ dns.retry }}  ; retry
                        {{ dns.expire }}  ; expire
                        {{ dns.minimum }}  ; minimum
                        )

; Name servers
{% for server in nameservers %}
{% for ns in server.ns %}
@           IN  NS      {{ ns }}.  ; {{ server.name }}
{% endfor %}
{% endfor %}

@           IN  A       {{ network.ipv4.address }}
@           IN  AAAA    {{ network.ipv6.address }}
dorm-x42    IN  A       58.196.142.84
office      IN  A       202.120.52.45
cluster     IN  A       202.120.52.63

*           IN  CNAME   @

; Mail server
{% if domain != network.domain %}
@           IN  MX      10  mail.{{ network.domain }}.
mail        IN  CNAME   mail.{{ network.domain }}.
{% endif %}
@           IN  TXT     "v=spf1 mx -all"
@           IN  TXT     "google-site-verification={{ mail['google-site-verification'][domain] }}"
{% set ruatxt = " rua=mailto:" + mail.dmarc.rua[domain] + ";" %}
{% set ruf = mail.dmarc.ruf | default({}) %}
{% if ruf[domain] is defined %}
{% set ruftxt = " ruf=mailto:" + ruf[domain] + ";" %}
{% else %}
{% set ruftxt = "" %}
{% endif %}
_dmarc      IN  TXT     "v=DMARC1; p={{ mail.dmarc.p }}; sp={{ mail.dmarc.sp }}; pct={{ mail.dmarc.pct }}; adkim={{ mail.dmarc.adkim }}; aspf={{ mail.dmarc.aspf }}; fo={{ mail.dmarc.fo }};{{ ruatxt }}{{ ruftxt }}"
{% if domain_key is defined %}
{{ domain_key | dkim_record(selector=mail.dkim.selector) | join("\n") }}
{% endif %}

; vim: set ft=bindzone: