diff --git a/templates/zonefile.db.j2 b/templates/zonefile.db.j2 index 8966d2d..7176efa 100644 --- a/templates/zonefile.db.j2 +++ b/templates/zonefile.db.j2 @@ -15,9 +15,9 @@ $TTL 60 {% endfor %} {% for k, v in records.items() %} {% if v is mapping %} -{% if not k.endswith('.') %} -{{ generate_records(v, k + ('.' + scope if scope != '@' else '')) }} -{%- elif k.endswith('.' + item + '.') or k == (item + '.') %} +{% if not (k|string).endswith('.') %} +{{ generate_records(v, (k|string) + ('.' + scope if scope != '@' else '')) }} +{%- elif (k|string).endswith('.' + item + '.') or (k|string) == (item + '.') %} {{ generate_records(v, k) }} {%- endif %} {%- endif %}