network/salt/bind/reverse.zone

34 lines
1.0 KiB
Dns

$ORIGIN {{ domain }}.
$TTL 10M
@ IN SOA {{ pillar['bind']['master-ns'][ctx] }}. astro.spaceboyz.net. (
{{ pillar['bind']['serial'] }} ; serial
1H ; refresh
1M ; retry
2H ; expire
5M ; minimum
)
{%- for ns in pillar['bind']['public-ns'][ctx] %}
IN NS {{ ns }}.
{%- endfor %}
{%- if ctx == 'dn42' %}
{%- for net, hosts in pillar['hosts-inet'].items() %}
{%- for host, aaaa in hosts.items() %}
{%- set reverse = salt['network.reverse_ip'](aaaa) %}
{%- if reverse.endswith(domain) %}
{{ reverse.replace('.' ~ domain, '') }} IN PTR {{ host }}.{{ net }}.{{ pillar['bind']['root-domain'][ctx] }}.
{%- endif %}
{%- endfor %}
{%- endfor %}
{%- endif %}
{%- for net, hosts in pillar['hosts-inet6'][ctx].items() %}
{%- for host, aaaa in hosts.items() %}
{%- set reverse = salt['network.reverse_ip'](aaaa) %}
{%- if reverse.endswith(domain) %}
{{ reverse.replace('.' ~ domain, '') }} IN PTR {{ host }}.{{ net }}.{{ pillar['bind']['root-domain'][ctx] }}.
{%- endif %}
{%- endfor %}
{%- endfor %}