directory "<%= scope.lookupvar('::dns::vardir') %>";
<% unless scope.lookupvar('::dns::forwarders').empty? -%>
forwarders { <%= scope.lookupvar('::dns::forwarders').join("; ") %>; };
<% end -%>
<% unless [nil, :undefined, :undef, ''].include?(scope.lookupvar('::dns::forward')) -%>
forward <%= scope.lookupvar('::dns::forward') %>;
<% end -%>

recursion <%= scope.lookupvar('::dns::recursion') %>;
allow-query { <%= scope.lookupvar('::dns::allow_query').join("; ") %>; };
dnssec-enable <%= scope.lookupvar('::dns::dnssec_enable') %>;
dnssec-validation <%= scope.lookupvar('::dns::dnssec_validation') %>;

empty-zones-enable <%= scope.lookupvar('::dns::empty_zones_enable') %>;

<% unless [nil, :undefined, :undef, ''].include?(scope.lookupvar('::dns::dns_notify')) -%>
notify <%= scope.lookupvar('::dns::dns_notify') %>;
<% end -%>
<% unless [false, nil, :undefined, :undef, ''].include?(scope.lookupvar('::dns::listen_on_v6')) -%>
listen-on-v6 { <%= scope.lookupvar('::dns::listen_on_v6') %>; };
<% end -%>

<% unless scope.lookupvar('::dns::allow_recursion').empty? -%>
allow-recursion { <%= scope.lookupvar('::dns::allow_recursion').join("; ") %>; };
<% end -%>

<% if (@osfamily =~ /^(FreeBSD|DragonFly)$/) -%>
pid-file "/var/run/named/pid";
<% end -%>

<%- scope.lookupvar('::dns::additional_options').sort_by {|k, v| k}.each do |option, value| -%>
<%= option %> <%= value %>;
<%- end -%>
