full-dns/templates/main_zone.conf.j2
2022-03-11 11:43:32 +01:00

31 lines
1.2 KiB
Django/Jinja

$ORIGIN {{ main_zone.name }}.
$TTL {{ main_zone.ttl|default(3600) }}
{{ main_zone.name }}. SOA {{ main_zone.soa }}. {{ main_zone.email }}. (
{{ ansible_date_time.epoch }} ; serial
3600 ; refresh
900 ; retry
1209600 ; expire
1800 ; ttl
)
NS {{ server.hostname }}.
{% for satellite in satellites %}
NS {{ satellite.hostname }}.
{% endfor %}
{% for record in main_zone.records|default([])|json_query('[?type==`MX`]') %}
MX{% if record.opts is defined %} {{ record.opts }}{% endif %} {{ record.value }}
{% endfor %}
{{ server.hostname }}. IN A {{ server.public_ip }}
{% if server.public_ip6 is defined and not full_dns_ipv6_disabled -%}
{{ server.hostname }}. IN AAAA {{ server.public_ip6 }}
{% endif %}
{% for satellite in satellites %}
{{ satellite.hostname }}. IN A {{ satellite.public_ip }}
{% if satellite.public_ip6 is defined -%}
{{ satellite.hostname }}. IN AAAA {{ satellite.public_ip6 }}
{% endif %}
{% endfor %}
{% for record in main_zone.records|default([])|json_query('[?type!=`MX`]') %}
{{ record.name }} IN {{ record.type }}{% if record.opts is defined %} {{ record.opts }}{% endif %} {{ record.value }}
{% endfor %}