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: