Named \ Bind9 example config
I came across this nice example of a bind9 config file that handles multiple subnet\vlans\zones and treats them differently
1server:/var/named/etc/bind# cat named.conf
2acl "lan" {
3 "localhost";
4 192.168.16.0/24;
5};
6
7acl "guest" {
8 192.168.0.0/16;
9 10.0.0.0/8;
10};
11
12options {
13 directory "/var/cache/bind";
14 listen-on { "localhost"; };
15
16 auth-nxdomain no; # conform to RFC1035
17
18};
19
20include "/etc/bind/rndc.key";
21
22controls {
23 inet 127.0.0.1 port 953
24 allow { 127.0.0.1; } keys { "rndc-key"; };
25};
26
27view "internal" {
28 match-clients { "lan"; };
29
30 recursion yes;
31
32 // forwarders { 192.168.1.254; };
33 forwarders { 8.8.8.8; 8.8.4.4; } ;
34
35 include "/etc/bind/named.conf.internal";
36};
37
38view "guest" {
39 match-clients { "guest"; };
40 recursion yes;
41 include "/etc/bind/named.conf.guest";
42};
43
44view "external" {
45 match-clients { any; };
46 recursion no;
47 include "/etc/bind/named.conf.external";
48};