From b73f9e6897ad4806284ecb20fc3278ee3dc88586 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 18 Apr 2016 13:46:31 +0000 Subject: [PATCH] added 'forward ( only | first );' support for named.conf.local --- bind/files/arch/named.conf.local | 5 ++++- bind/files/debian/named.conf.local | 5 ++++- bind/files/redhat/named.conf.local | 5 ++++- pillar.example | 6 ++++++ 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/bind/files/arch/named.conf.local b/bind/files/arch/named.conf.local index e1b5703..75f9faf 100644 --- a/bind/files/arch/named.conf.local +++ b/bind/files/arch/named.conf.local @@ -12,10 +12,13 @@ zone "{{ key }}" { type {{ args['type'] }}; {% if args['type'] == 'forward' -%} + {% if args['forward'] is defined -%} + forward {{ args['forward'] }}; + {%- endif %} forwarders { {% for forwarder in args.forwarders -%} {{ forwarder }}; - {% endfor -%} + {%- endfor %} }; {% else -%} file "{{ file }}"; diff --git a/bind/files/debian/named.conf.local b/bind/files/debian/named.conf.local index 5f2c20f..c24b4ad 100644 --- a/bind/files/debian/named.conf.local +++ b/bind/files/debian/named.conf.local @@ -11,10 +11,13 @@ zone "{{ key }}" { type {{ args['type'] }}; {% if args['type'] == 'forward' -%} + {% if args['forward'] is defined -%} + forward {{ args['forward'] }}; + {%- endif %} forwarders { {% for forwarder in args.forwarders -%} {{ forwarder }}; - {% endfor -%} + {%- endfor %} }; {% else -%} {% if args['dnssec'] is defined and args['dnssec'] -%} diff --git a/bind/files/redhat/named.conf.local b/bind/files/redhat/named.conf.local index e193271..89e7bf9 100644 --- a/bind/files/redhat/named.conf.local +++ b/bind/files/redhat/named.conf.local @@ -12,10 +12,13 @@ zone "{{ key }}" { type {{ args['type'] }}; {% if args['type'] == 'forward' -%} + {% if args['forward'] is defined -%} + forward {{ args['forward'] }}; + {%- endif %} forwarders { {% for forwarder in args.forwarders -%} {{ forwarder }}; - {% endfor -%} + {%- endfor %} }; {% else -%} file "data/{{ file }}"; diff --git a/pillar.example b/pillar.example index 18ec3d8..4c4c8c6 100644 --- a/pillar.example +++ b/pillar.example @@ -47,6 +47,12 @@ bind: forwarders: - 10.9.8.7 - 10.9.8.5 + sub.forwardonlydomain.com: + type: forward + forward: only + forwarders: + - 10.9.8.8 + - 10.9.8.9 configured_views: myview1: match_clients: