2e2c49
/*
2e2c49
 Sample named.conf BIND DNS server 'named' configuration file
2e2c49
 for the Red Hat BIND distribution.
2e2c49
2e2c49
 See the BIND Administrator's Reference Manual (ARM) for details, in:
2e2c49
   file:///usr/share/doc/bind-{version}/arm/Bv9ARM.html
2e2c49
 Also see the BIND Configuration GUI : /usr/bin/system-config-bind and 
2e2c49
 its manual.
2e2c49
*/
2e2c49
2e2c49
options
2e2c49
{
2e2c49
	// Put files that named is allowed to write in the data/ directory:
2e2c49
	directory 		"/var/named";		// "Working" directory
2e2c49
	dump-file 		"data/cache_dump.db";
2e2c49
        statistics-file 	"data/named_stats.txt";
2e2c49
        memstatistics-file 	"data/named_mem_stats.txt";
2e2c49
	secroots-file		"data/named.secroots";
2e2c49
	recursing-file		"data/named.recursing";
2e2c49
2e2c49
2e2c49
	/*
2e2c49
	  Specify listenning interfaces. You can use list of addresses (';' is
2e2c49
	  delimiter) or keywords "any"/"none"
2e2c49
	*/
2e2c49
	//listen-on port 53	{ any; };
2e2c49
	listen-on port 53	{ 127.0.0.1; };
2e2c49
2e2c49
	//listen-on-v6 port 53	{ any; };
2e2c49
	listen-on-v6 port 53	{ ::1; };
2e2c49
2e2c49
	/*
2e2c49
	  Access restrictions
2e2c49
2e2c49
	  There are two important options:
2e2c49
	    allow-query { argument; };
2e2c49
	      - allow queries for authoritative data
2e2c49
2e2c49
	    allow-query-cache { argument; };
2e2c49
	      - allow queries for non-authoritative data (mostly cached data)
2e2c49
2e2c49
	  You can use address, network address or keywords "any"/"localhost"/"none" as argument
2e2c49
	  Examples:
2e2c49
	    allow-query { localhost; 10.0.0.1; 192.168.1.0/8; };
2e2c49
	    allow-query-cache { ::1; fe80::5c63:a8ff:fe2f:4526; 10.0.0.1; };
2e2c49
	*/
2e2c49
2e2c49
	allow-query		{ localhost; };
2e2c49
	allow-query-cache	{ localhost; };
2e2c49
2e2c49
	/* Enable/disable recursion - recursion yes/no;
2e2c49
2e2c49
	 - If you are building an AUTHORITATIVE DNS server, do NOT enable recursion.
2e2c49
	 - If you are building a RECURSIVE (caching) DNS server, you need to enable 
2e2c49
	   recursion. 
2e2c49
	 - If your recursive DNS server has a public IP address, you MUST enable access 
2e2c49
	   control to limit queries to your legitimate users. Failing to do so will
2e2c49
	   cause your server to become part of large scale DNS amplification 
2e2c49
	   attacks. Implementing BCP38 within your network would greatly
2e2c49
	   reduce such attack surface 
2e2c49
	 */
2e2c49
	recursion yes;
2e2c49
2e2c49
	/* DNSSEC related options. See information about keys ("Trusted keys", bellow) */
2e2c49
2e2c49
	/* Enable serving of DNSSEC related data - enable on both authoritative
2e2c49
 	   and recursive servers DNSSEC aware servers */
2e2c49
	dnssec-enable yes;
2e2c49
2e2c49
	/* Enable DNSSEC validation on recursive servers */
2e2c49
	dnssec-validation yes;
2e2c49
2e2c49
	/* In Fedora we use /run/named instead of default /var/run/named
2e2c49
	   so we have to configure paths properly. */
2e2c49
	pid-file "/run/named/named.pid";
2e2c49
	session-keyfile "/run/named/session.key";
2e2c49
2e2c49
	managed-keys-directory "/var/named/dynamic";
2e2c49
2e2c49
    /* In Fedora we use system-wide Crypto Policy */
2e2c49
    /* https://fedoraproject.org/wiki/Changes/CryptoPolicy */
2e2c49
    include "/etc/crypto-policies/back-ends/bind.config";
2e2c49
};
2e2c49
2e2c49
logging 
2e2c49
{
2e2c49
/*      If you want to enable debugging, eg. using the 'rndc trace' command,
2e2c49
 *      named will try to write the 'named.run' file in the $directory (/var/named).
2e2c49
 *      By default, SELinux policy does not allow named to modify the /var/named directory,
2e2c49
 *      so put the default debug log file in data/ :
2e2c49
 */
2e2c49
        channel default_debug {
2e2c49
                file "data/named.run";
2e2c49
                severity dynamic;
2e2c49
        };
2e2c49
};
2e2c49
2e2c49
/*
2e2c49
 Views let a name server answer a DNS query differently depending on who is asking.
2e2c49
2e2c49
 By default, if named.conf contains no "view" clauses, all zones are in the 
2e2c49
 "default" view, which matches all clients.
2e2c49
2e2c49
 Views are processed sequentially. The first match is used so the last view should
2e2c49
 match "any" - it's fallback and the most restricted view.
2e2c49
2e2c49
 If named.conf contains any "view" clause, then all zones MUST be in a view.
2e2c49
*/
2e2c49
2e2c49
view "localhost_resolver"
2e2c49
{
2e2c49
/* This view sets up named to be a localhost resolver ( caching only nameserver ).
2e2c49
 * If all you want is a caching-only nameserver, then you need only define this view:
2e2c49
 */
2e2c49
	match-clients 		{ localhost; };
2e2c49
	recursion yes;
2e2c49
2e2c49
	# all views must contain the root hints zone:
2e2c49
	zone "." IN {
2e2c49
	        type hint;
2e2c49
	        file "/var/named/named.ca";
2e2c49
	};
2e2c49
2e2c49
        /* these are zones that contain definitions for all the localhost
2e2c49
         * names and addresses, as recommended in RFC1912 - these names should
2e2c49
	 * not leak to the other nameservers:
2e2c49
	 */
2e2c49
	include "/etc/named.rfc1912.zones";
2e2c49
};
2e2c49
view "internal"
2e2c49
{
2e2c49
/* This view will contain zones you want to serve only to "internal" clients
2e2c49
   that connect via your directly attached LAN interfaces - "localnets" .
2e2c49
 */
2e2c49
	match-clients		{ localnets; };
2e2c49
	recursion yes;
2e2c49
2e2c49
	zone "." IN {
2e2c49
	        type hint;
2e2c49
	        file "/var/named/named.ca";
2e2c49
	};
2e2c49
2e2c49
        /* these are zones that contain definitions for all the localhost
2e2c49
         * names and addresses, as recommended in RFC1912 - these names should
2e2c49
	 * not leak to the other nameservers:
2e2c49
	 */
2e2c49
	include "/etc/named.rfc1912.zones";
2e2c49
2e2c49
	// These are your "authoritative" internal zones, and would probably
2e2c49
	// also be included in the "localhost_resolver" view above :
2e2c49
2e2c49
	/*
2e2c49
	  NOTE for dynamic DNS zones and secondary zones:
2e2c49
2e2c49
	  DO NOT USE SAME FILES IN MULTIPLE VIEWS!
2e2c49
2e2c49
	  If you are using views and DDNS/secondary zones it is strongly
2e2c49
	  recommended to read FAQ on ISC site (www.isc.org), section
2e2c49
	  "Configuration and Setup Questions", questions
2e2c49
	  "How do I share a dynamic zone between multiple views?" and
2e2c49
	  "How can I make a server a slave for both an internal and an external
2e2c49
	   view at the same time?"
2e2c49
	*/
2e2c49
2e2c49
	zone "my.internal.zone" { 
2e2c49
		type master;
2e2c49
		file "my.internal.zone.db";
2e2c49
	};
2e2c49
	zone "my.slave.internal.zone" {
2e2c49
		type slave;
2e2c49
		file "slaves/my.slave.internal.zone.db";
2e2c49
		masters { /* put master nameserver IPs here */ 127.0.0.1; } ;
2e2c49
		// put slave zones in the slaves/ directory so named can update them
2e2c49
	};	
2e2c49
	zone "my.ddns.internal.zone" {
2e2c49
		type master;
2e2c49
		allow-update { key ddns_key; };
2e2c49
		file "dynamic/my.ddns.internal.zone.db";
2e2c49
		// put dynamically updateable zones in the slaves/ directory so named can update them
2e2c49
	};
2e2c49
};
2e2c49
2e2c49
key ddns_key
2e2c49
{
2e2c49
	algorithm hmac-md5;
2e2c49
	secret "use /usr/sbin/dnssec-keygen to generate TSIG keys";
2e2c49
};
2e2c49
2e2c49
view "external"
2e2c49
{
2e2c49
/* This view will contain zones you want to serve only to "external" clients
2e2c49
 * that have addresses that are not match any above view:
2e2c49
 */
2e2c49
	match-clients		{ any; };
2e2c49
2e2c49
	zone "." IN {
2e2c49
	        type hint;
2e2c49
	        file "/var/named/named.ca";
2e2c49
	};
2e2c49
2e2c49
	recursion no;
2e2c49
	// you'd probably want to deny recursion to external clients, so you don't
2e2c49
        // end up providing free DNS service to all takers
2e2c49
2e2c49
	// These are your "authoritative" external zones, and would probably
2e2c49
        // contain entries for just your web and mail servers:
2e2c49
2e2c49
	zone "my.external.zone" { 
2e2c49
		type master;
2e2c49
		file "my.external.zone.db";
2e2c49
	};
2e2c49
};
2e2c49
2e2c49
/* Trusted keys
2e2c49
2e2c49
  This statement contains DNSSEC keys. If you want DNSSEC aware resolver you
2e2c49
  have to configure at least one trusted key.
2e2c49
2e2c49
  Note that no key written below is valid. Especially root key because root zone
2e2c49
  is not signed yet.
2e2c49
*/
2e2c49
/*
2e2c49
trusted-keys {
2e2c49
// Root Key
2e2c49
"." 257 3 3 "BNY4wrWM1nCfJ+CXd0rVXyYmobt7sEEfK3clRbGaTwSJxrGkxJWoZu6I7PzJu/
2e2c49
             E9gx4UC1zGAHlXKdE4zYIpRhaBKnvcC2U9mZhkdUpd1Vso/HAdjNe8LmMlnzY3
2e2c49
             zy2Xy4klWOADTPzSv9eamj8V18PHGjBLaVtYvk/ln5ZApjYghf+6fElrmLkdaz
2e2c49
             MQ2OCnACR817DF4BBa7UR/beDHyp5iWTXWSi6XmoJLbG9Scqc7l70KDqlvXR3M
2e2c49
             /lUUVRbkeg1IPJSidmK3ZyCllh4XSKbje/45SKucHgnwU5jefMtq66gKodQj+M
2e2c49
             iA21AfUVe7u99WzTLzY3qlxDhxYQQ20FQ97S+LKUTpQcq27R7AT3/V5hRQxScI
2e2c49
             Nqwcz4jYqZD2fQdgxbcDTClU0CRBdiieyLMNzXG3";
2e2c49
2e2c49
// Key for forward zone
2e2c49
example.com. 257 3 5 "AwEAAaxPMcR2x0HbQV4WeZB6oEDX+r0QM65KbhTjrW1ZaARmPhEZZe
2e2c49
                      3Y9ifgEuq7vZ/zGZUdEGNWy+JZzus0lUptwgjGwhUS1558Hb4JKUbb
2e2c49
                      OTcM8pwXlj0EiX3oDFVmjHO444gLkBO UKUf/mC7HvfwYH/Be22GnC
2e2c49
                      lrinKJp1Og4ywzO9WglMk7jbfW33gUKvirTHr25GL7STQUzBb5Usxt
2e2c49
                      8lgnyTUHs1t3JwCY5hKZ6CqFxmAVZP20igTixin/1LcrgX/KMEGd/b
2e2c49
                      iuvF4qJCyduieHukuY3H4XMAcR+xia2 nIUPvm/oyWR8BW/hWdzOvn
2e2c49
                      SCThlHf3xiYleDbt/o1OTQ09A0=";
2e2c49
2e2c49
// Key for reverse zone.
2e2c49
2.0.192.IN-ADDRPA.NET. 257 3 5 "AQOnS4xn/IgOUpBPJ3bogzwcxOdNax071L18QqZnQQQA
2e2c49
                                VVr+iLhGTnNGp3HoWQLUIzKrJVZ3zggy3WwNT6kZo6c0
2e2c49
                                tszYqbtvchmgQC8CzKojM/W16i6MG/ea fGU3siaOdS0
2e2c49
                                yOI6BgPsw+YZdzlYMaIJGf4M4dyoKIhzdZyQ2bYQrjyQ
2e2c49
                                4LB0lC7aOnsMyYKHHYeRv PxjIQXmdqgOJGq+vsevG06
2e2c49
                                zW+1xgYJh9rCIfnm1GX/KMgxLPG2vXTD/RnLX+D3T3UL
2e2c49
                                7HJYHJhAZD5L59VvjSPsZJHeDCUyWYrvPZesZDIRvhDD
2e2c49
                                52SKvbheeTJUm6EhkzytNN2SN96QRk8j/iI8ib";
2e2c49
};
2e2c49
*/