feat: add ttl for record

This commit is contained in:
Adrien Waksberg 2018-03-17 00:36:43 +01:00
parent 5634103cfd
commit a46f82ba2c
3 changed files with 5 additions and 5 deletions

View file

@ -41,7 +41,7 @@ bind_zones:
dnssec: yes
entries:
- { name: '@', type: ns, value: localhost. }
- { name: hello, type: a, value: 1.2.3.4 }
- { name: hello, type: a, ttl: 5m, value: 1.2.3.4 }
hello.local:
ns_primary: ns1.hello.local
mail: root@hello.local

View file

@ -11,15 +11,15 @@ $TTL {{ item.value.ttl|default(3600) }}
{% for entry in item.value.entries %}
{% if entry.type|upper == 'MX' %}
{{ entry.name }}{% for i in range(0, 15 - entry.name|length) %} {% endfor %} IN MX {{ entry.priority }} {{ entry.value }}
{{ entry.name }} {{ entry.ttl|default(' ') }} IN MX {{ entry.priority }} {{ entry.value }}
{% elif entry.type|upper == 'TXT' %}
{{ entry.name }}{% for i in range(0, 15 - entry.name|length) %} {% endfor %} IN {{ entry.type|upper }} (
{{ entry.name }} {{ entry.ttl|default(' ') }} IN {{ entry.type|upper }} (
{% for charset in entry.value|batch(64) %}
"{{ charset|join('') }}"
{% endfor %}
)
{% else %}
{{ entry.name }}{% for i in range(0, 15 - entry.name|length) %} {% endfor %} IN {{ entry.type|upper }}{% for i in range(0, 9 - entry.type|length) %} {% endfor %} {{ entry.value }}
{{ entry.name }} {{ entry.ttl|default(' ') }} IN {{ entry.type|upper }} {{ entry.value }}
{% endif %}
{% endfor %}
{% if 'dnssec' in item.value and item.value.dnssec %}

View file

@ -19,7 +19,7 @@
entries:
- { name: '@', type: mx, priority: 20, value: mail.test.local. }
- { name: '@', type: ns, value: localhost. }
- { name: hello, type: a, value: 1.2.3.4 }
- { name: hello, type: a, ttl: 5m, value: 1.2.3.4 }
hello.local:
ns_primary: ns1.hello.local
mail: root@hello.local