Added the allow-recursion statement for when recursion enabled in a view.

Unless specified, this defaults to "localnets, localhost only" yet the
intention of specifying a match-clients and recursion is to allow recursive
queries from the given address not just localnets. This change adds the
specified match-clients under allow-recursion.

If match-destination is specified instead, then allow-recusion-on is
set for those interfaces.
This commit is contained in:
Brian Muita 2014-11-27 18:39:02 +03:00
parent f5cf852939
commit 658a2cdb9b

View File

@ -15,6 +15,20 @@ view "<%= @name %>" {
};
<%- end -%>
recursion <%= @recursion ? 'yes' : 'no' %>;
<%- if @recursion -%>
<%- if @match_clients and @match_clients != '' -%>
allow-recursion {
<%- Array(@match_clients).each do |match_client| -%>
<%= match_client %>;
<%- end -%>
<%- elsif @match_destinations and @match_destinations != '' -%>
allow-recursion-on {
<%- Array(@match_destinations).each do |match_destination| -%>
<%= match_destination %>;
<%- end -%>
<%- end -%>
};
<%- end -%>
<%- if scope.lookupvar('osfamily') == 'Debian' -%>
include "<%= @confdir %>/named.conf.default-zones";
<%- end -%>