From 658a2cdb9bb16fdfc8f1f208423b5fe476c840b3 Mon Sep 17 00:00:00 2001 From: Brian Muita Date: Thu, 27 Nov 2014 18:39:02 +0300 Subject: [PATCH] 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. --- templates/view.erb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/templates/view.erb b/templates/view.erb index 839e1ef..866afd7 100644 --- a/templates/view.erb +++ b/templates/view.erb @@ -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 -%>