dataset/seed/nsd/templates/nsd.reverse

33 lines
1.1 KiB
Text
Raw Normal View History

2022-03-08 19:42:28 +01:00
%set %%name = None
%set %%network = %%str(%%nsd_reverse_network[%%rougail_index]).rsplit('.', 1)[0]
2022-08-18 10:19:43 +02:00
%for %%zone in %%nsd_zones
2022-03-08 19:42:28 +01:00
%set %%suffix = %%normalize_family(%%zone)
%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 = %%str(%%zone)
$ORIGIN %%rougail_variable
$TTL 1800
@ 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
IN NS %%domain_name_eth0.
%end if
%set %%ip = %%hostname['ip_' + %%suffix]
%if %%ip.startswith(%%network)
2022-03-08 19:42:28 +01:00
%set %%id = %%ip.rsplit('.', 1)[1]
%%id PTR %%hostname.%%{zone}.
%end if
%end if
%end for
%end for