jvdias 053216
//
jvdias 053216
// Sample named.conf BIND DNS server 'named' configuration file
jvdias 053216
// for the Red Hat BIND distribution.
jvdias 053216
//
jvdias 053216
// See the BIND Administrator's Reference Manual (ARM) for details, in:
jvdias 053216
//   file:///usr/share/doc/bind-*/arm/Bv9ARM.html
jvdias 053216
// Also see the BIND Configuration GUI : /usr/bin/system-config-bind and 
jvdias 053216
// its manual.
jvdias 053216
//
jvdias 053216
options
jvdias 053216
{
jvdias 053216
	// Put files that named is allowed to write in the data/ directory:
jvdias 053216
	directory "/var/named"; // the default
jvdias 053216
	dump-file 		"data/cache_dump.db";
jvdias 053216
        statistics-file 	"data/named_stats.txt";
jvdias 053216
        memstatistics-file 	"data/named_mem_stats.txt";
jvdias 053216
jvdias 053216
};
jvdias 053216
logging 
jvdias 053216
{
jvdias 053216
/*      If you want to enable debugging, eg. using the 'rndc trace' command,
jvdias 053216
 *      named will try to write the 'named.run' file in the $directory (/var/named).
jvdias 053216
 *      By default, SELinux policy does not allow named to modify the /var/named directory,
jvdias 053216
 *      so put the default debug log file in data/ :
jvdias 053216
 */
jvdias 053216
        channel default_debug {
jvdias 053216
                file "data/named.run";
jvdias 053216
                severity dynamic;
jvdias 053216
        };	
jvdias 053216
};
jvdias 053216
//
jvdias 053216
// All BIND 9 zones are in a "view", which allow different zones to be served
jvdias 053216
// to different types of client addresses, and for options to be set for groups
jvdias 053216
// of zones.
jvdias 053216
//
jvdias 053216
// By default, if named.conf contains no "view" clauses, all zones are in the 
jvdias 053216
// "default" view, which matches all clients.
jvdias 053216
// 
jvdias 053216
// If named.conf contains any "view" clause, then all zones MUST be in a view; 
jvdias 053216
// so it is recommended to start off using views to avoid having to restructure
jvdias 053216
// your configuration files in the future.
jvdias 053216
//
jvdias 053216
view "localhost_resolver"
jvdias 053216
{
jvdias 053216
/* This view sets up named to be a localhost resolver ( caching only nameserver ).
jvdias 053216
 * If all you want is a caching-only nameserver, then you need only define this view:
jvdias 053216
 */
jvdias 053216
	match-clients 		{ localhost; };
jvdias 053216
	recursion yes;
jvdias 053216
	# all views must contain the root hints zone:
jvdias 053216
	include "/etc/named.root.hints";
jvdias 053216
jvdias 053216
        /* these are zones that contain definitions for all the localhost
jvdias 053216
         * names and addresses, as recommended in RFC1912 - these names should
Adam Tkac 95fd5e
	 * not leak to the other nameservers:
jvdias 053216
	 */
jvdias 053216
	include "/etc/named.rfc1912.zones";
jvdias 053216
};
jvdias 053216
view "internal"
jvdias 053216
{
jvdias 053216
/* This view will contain zones you want to serve only to "internal" clients
jvdias 053216
   that connect via your directly attached LAN interfaces - "localnets" .
jvdias 053216
 */
jvdias fc31cd
	match-clients		{ localnets; };
jvdias 053216
	recursion yes;
jvdias 053216
	// all views must contain the root hints zone:
jvdias 053216
	include "/etc/named.root.hints";
jvdias 053216
Adam Tkac 95fd5e
Adam Tkac 95fd5e
        /* these are zones that contain definitions for all the localhost
Adam Tkac 95fd5e
         * names and addresses, as recommended in RFC1912 - these names should
Adam Tkac 95fd5e
	 * not leak to the other nameservers:
Adam Tkac 95fd5e
	 */
Adam Tkac 95fd5e
	include "/etc/named.rfc1912.zones";
jvdias 053216
 
jvdias 053216
	// These are your "authoritative" internal zones, and would probably
jvdias 053216
	// also be included in the "localhost_resolver" view above :
jvdias 053216
jvdias 053216
	zone "my.internal.zone" { 
jvdias 053216
		type master;
jvdias 053216
		file "my.internal.zone.db";
jvdias 053216
	};
jvdias 053216
	zone "my.slave.internal.zone" {
jvdias 053216
		type slave;
jvdias 053216
		file "slaves/my.slave.internal.zone.db";
jvdias 053216
		masters { /* put master nameserver IPs here */ 127.0.0.1; } ;
jvdias 053216
		// put slave zones in the slaves/ directory so named can update them
jvdias 053216
	};	
jvdias 053216
	zone "my.ddns.internal.zone" {
jvdias 053216
		type master;
jvdias 053216
		allow-update { key ddns_key; };
jvdias 053216
		file "slaves/my.ddns.internal.zone.db";
jvdias 053216
		// put dynamically updateable zones in the slaves/ directory so named can update them
jvdias 053216
	};			
jvdias 053216
};
jvdias 053216
key ddns_key
jvdias 053216
{
jvdias 053216
	algorithm hmac-md5;
jvdias 053216
	secret "use /usr/sbin/dns-keygen to generate TSIG keys";
jvdias 053216
};
jvdias 053216
view    "external"
jvdias 053216
{
jvdias 053216
/* This view will contain zones you want to serve only to "external" clients
Adam Tkac 95fd5e
 * that have addresses that are not match any above view:
jvdias 053216
 */
Adam Tkac 95fd5e
	match-clients		{ any; };
jvdias 053216
jvdias 053216
	recursion no;
jvdias 053216
	// you'd probably want to deny recursion to external clients, so you don't
jvdias 053216
        // end up providing free DNS service to all takers
jvdias 053216
jvdias 053216
	// all views must contain the root hints zone:
jvdias 053216
	include "/etc/named.root.hints";
jvdias 053216
jvdias 053216
	// These are your "authoritative" external zones, and would probably
jvdias 053216
        // contain entries for just your web and mail servers:
jvdias 053216
jvdias 053216
	zone "my.external.zone" { 
jvdias 053216
		type master;
jvdias 053216
		file "my.external.zone.db";
jvdias 053216
	};
jvdias 053216
};