netbox-exporter/templates/zonefile.jj2.dist

26 lines
699 B
Text
Raw Permalink Normal View History

2021-04-08 18:27:54 +00:00
$TTL 86400
@ IN SOA ns1.example.com. hostmaster.example.com. (
{{ serial }} ; Serial
4H ; Refresh
1H ; Retry
1W ; Expire
1D ) ; Minimum TTL
@ IN NS ns1.example.com.
@ IN NS ns2.example.com.
2022-11-11 22:42:35 +00:00
{% for extra_record in extra_records -%}
{{ extra_record.rr }} IN {{ extra_record.type }} {{ extra_record.data }}
{% endfor -%}
2021-04-08 18:27:54 +00:00
{% for record, rrs in records.items() -%}
{% for rr in rrs -%}
{% if not record.endswith('.') -%}
{% set record = record + "." -%}
{% endif -%}
{% if rr.type in ['PTR'] and not rr.rr.endswith('.') -%}
{% set update = rr.update({'rr':rr.rr + "."}) -%}
{% endif -%}
{{ record }} IN {{ rr.type }} {{ rr.rr }}
{% endfor -%}
{% endfor -%}