full-dns/templates/main_zone.conf.j2
Blallo 3f58459e78
Update configuration and logic. Support ipv6.
Now ipv6 is supported using `public_ipv6` in the `server` block and
refactoring the configuration logic.
Also fix unbound configuration to allow recursive queries from
resolvers.
2020-08-19 18:47:56 +02:00

31 lines
1.1 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 -%}
{{ 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 %}