
	directory "/";
	stale-cache-enable no;
	
	# set PID and dump file path.
	pid-file "var/run/named.pid";
	
	# set the path for the statistics and dump files
	statistics-file "var/log/named.stats";
	memstatistics-file "var/log/named.memory";
	dump-file "var/log/named_dump.db";
	
	# set Bind9 max memory usage on the server.
	datasize 3600M;	   
	
	# set size and max ttl for caches
	max-cache-ttl 86400;
	max-ncache-ttl 3600;
	max-cache-size 2048M;
 	
	# set size of edns et mex udp size.
	edns-udp-size 4096;
	max-udp-size 4096;

	# Prevent attacker from requesting the version, hostname or the server-id
	version none;
	hostname none;
	server-id none;
	
	# Set interface to listen on for IPv4/6
	listen-on-v6 { none; };
        listen-on port 53 { any; };
	
	# Setting for recursive server:
	allow-transfer { none; };
	allow-query { mobiles; others; };
	allow-query-cache { mobiles; others; };
	allow-recursion { mobiles; others;};
	minimal-responses yes;

	recursive-clients 20000;
	tcp-clients 200;
	clients-per-query 100;
	max-clients-per-query 500;
	
	# limit simultaneous fetch per zone.
	fetches-per-zone 100;

        # Setting for DNSSEC
        dnssec-validation no;

};

key "rndc-key" {
		algorithm hmac-md5;
		secret "L4FHPtYrtxaYwLuFgcI2cg==";
};

controls {
		inet 127.0.0.1 port 953 allow { 127.0.0.1; } keys { "rndc-key"; };
};

logging {

	category default				{ default_channel; };
	category general				{ general_channel; };
	#category queries				{ query_channel; };
	category resolver				{ resolver_channel; };
	category spill					{ spill_channel; };
	category rpz					{ rpz_channel; };
	
	category lame-servers			{ null; };
	category edns-disabled			{ null; };
	
	channel default_channel {
		file "var/log/default.log" versions 5 size 5M ;
		severity dynamic;
		print-category yes;
		print-severity yes;
		print-time yes;
	};
	
	# // Query logging. Enabling this channel will strongly impact the DNS performance.
	# channel query_channel {
		# file "var/log/query.log" versions 5 size 5M ;
		# severity info;
		# print-time yes;
	# };

	channel general_channel {
		file "var/log/general.log" versions 5 size 5M ;
		severity info;
		print-time yes;
	};
	
	channel resolver_channel {
		file "var/log/resolver.log" versions 5 size 10M ;
		severity info;
		print-severity yes;
		print-category yes;
	};

	channel spill_channel {
		file "var/log/spill.log" versions 5 size 10M ;
		severity info;
		print-category yes;
		print-severity yes;
		print-time yes;
	};	
	channel rpz_channel {
		file "var/log/rpz.log" versions 3 size 250k;
		severity info;
		print-category yes;
		print-severity yes;
		print-time yes;
  };
 
};

include "etc/acl.conf";   // Liste des ACL
include "etc/views.conf"; // Views
