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