dataset/seed/nsd/templates/nsd.reverse

33 lines
1.1 KiB
Text
Raw Normal View History

2023-06-23 08:12:05 +02:00
{% set name = None %}
{% set network = nsd_reverse_networks[rougail_index]|string %}
{% for zone in nsd_zones %}
{% set suffix = zone|normalize_family %}
{% set hostnames = nsd["nsd_zone_" + suffix]["hostname_" + suffix]["hostname_" + suffix] %}
{% for hostname in hostnames %}
{% set type = hostname['type_' + suffix] %}
{% if type == 'A' %}
{% if not name %}
{% set name = zone|string %}
$ORIGIN {{ rougail_variable }}
2022-03-08 19:42:28 +01:00
$TTL 1800
2023-06-23 08:12:05 +02:00
@ IN SOA {{ domain_name_eth0 }}. admin.{{ name }}. (
2022-05-04 10:29:03 +02:00
0000000000 ; serial number
2022-03-08 19:42:28 +01:00
3600 ; refresh
900 ; retry
1209600 ; expire
1800 ; ttl
)
; Name servers
2023-06-23 08:12:05 +02:00
IN NS {{ domain_name_eth0 }}.
{% endif %}
{% set ip = hostname['ip_' + suffix] %}
{% if ip.startswith(network) %}
{% set id = ip.rsplit('.', 1)[1] %}
{{ id }} PTR {{ hostname }}.{{zone}}.
{% endif %}
{% endif %}
{% endfor %}
{% endfor %}