### Autogenerated by dynamic_dns.py ###
daemon=1m
syslog=yes
ssl=yes

{% if interface is vyos_defined %}
{%     for iface, iface_config in interface.items() %}
# ddclient configuration for interface "{{ iface }}"
{%         if iface_config.use_web is vyos_defined %}
{%             set web_skip = ", web-skip='" ~ iface_config.use_web.skip ~ "'" if iface_config.use_web.skip is vyos_defined else '' %}
use=web, web='{{ iface_config.use_web.url }}'{{ web_skip }}
{%         else %}
{{ 'usev6=ifv6' if iface_config.ipv6_enable is vyos_defined else 'use=if' }}, if={{ iface }}
{%         endif %}

{%         if iface_config.rfc2136 is vyos_defined %}
{%             for rfc2136, config in iface_config.rfc2136.items() %}
{%                 for dns_record in config.record if config.record is vyos_defined %}
# RFC2136 dynamic DNS configuration for {{ rfc2136 }}, {{ config.zone }}, {{ dns_record }}
server={{ config.server }}
protocol=nsupdate
password={{ config.key }}
ttl={{ config.ttl }}
zone={{ config.zone }}
{{ dns_record }}

{%                 endfor %}
{%             endfor %}
{%         endif %}

{%         if iface_config.service is vyos_defined %}
{%             for service, config in iface_config.service.items() %}
{%                 for dns_record in config.host_name %}
# DynDNS provider configuration for {{ service }}, {{ dns_record }}
protocol={{ config.protocol }},
max-interval=28d,
{%                     if config.login is vyos_defined %}
login={{ config.login }},
{%                     endif %}
password='{{ config.password }}',
{%                     if config.server is vyos_defined %}
server={{ config.server }},
{%                     endif %}
{%                     if config.zone is vyos_defined %}
zone={{ config.zone }},
{%                     endif %}
{{ dns_record }}

{%                 endfor %}
{%             endfor %}
{%         endif %}
{%     endfor %}
{% endif %}