2008-12-01 16:01:44 +00:00
|
|
|
/*
|
|
|
|
Sample named.conf BIND DNS server 'named' configuration file
|
|
|
|
for the Red Hat BIND distribution.
|
|
|
|
|
|
|
|
See the BIND Administrator's Reference Manual (ARM) for details, in:
|
|
|
|
file:///usr/share/doc/bind-{version}/arm/Bv9ARM.html
|
|
|
|
Also see the BIND Configuration GUI : /usr/bin/system-config-bind and
|
|
|
|
its manual.
|
|
|
|
*/
|
|
|
|
|
2006-03-30 00:52:34 +00:00
|
|
|
options
|
|
|
|
{
|
|
|
|
// Put files that named is allowed to write in the data/ directory:
|
2008-12-01 16:01:44 +00:00
|
|
|
directory "/var/named"; // "Working" directory
|
2006-03-30 00:52:34 +00:00
|
|
|
dump-file "data/cache_dump.db";
|
|
|
|
statistics-file "data/named_stats.txt";
|
|
|
|
memstatistics-file "data/named_mem_stats.txt";
|
|
|
|
|
2008-12-01 16:01:44 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
Specify listenning interfaces. You can use list of addresses (';' is
|
|
|
|
delimiter) or keywords "any"/"none"
|
|
|
|
*/
|
|
|
|
//listen-on port 53 { any; };
|
|
|
|
listen-on port 53 { 127.0.0.1; };
|
|
|
|
|
|
|
|
//listen-on-v6 port 53 { any; };
|
|
|
|
listen-on-v6 port 53 { ::1; };
|
|
|
|
|
|
|
|
/*
|
|
|
|
Access restrictions
|
|
|
|
|
|
|
|
There are two important options:
|
|
|
|
allow-query { argument; };
|
|
|
|
- allow queries for authoritative data
|
|
|
|
|
|
|
|
allow-query-cache { argument; };
|
|
|
|
- allow queries for non-authoritative data (mostly cached data)
|
|
|
|
|
|
|
|
You can use address, network address or keywords "any"/"localhost"/"none" as argument
|
|
|
|
Examples:
|
|
|
|
allow-query { localhost; 10.0.0.1; 192.168.1.0/8; };
|
|
|
|
allow-query-cache { ::1; fe80::5c63:a8ff:fe2f:4526; 10.0.0.1; };
|
|
|
|
*/
|
|
|
|
|
|
|
|
allow-query { localhost; };
|
|
|
|
allow-query-cache { localhost; };
|
|
|
|
|
2013-05-03 10:50:12 +00:00
|
|
|
/* Enable/disable recursion - recursion yes/no;
|
|
|
|
|
|
|
|
- If you are building an AUTHORITATIVE DNS server, do NOT enable recursion.
|
|
|
|
- If you are building a RECURSIVE (caching) DNS server, you need to enable
|
|
|
|
recursion.
|
|
|
|
- If your recursive DNS server has a public IP address, you MUST enable access
|
|
|
|
control to limit queries to your legitimate users. Failing to do so will
|
|
|
|
cause your server to become part of large scale DNS amplification
|
|
|
|
attacks. Implementing BCP38 within your network would greatly
|
|
|
|
reduce such attack surface
|
|
|
|
*/
|
2008-12-01 16:01:44 +00:00
|
|
|
recursion yes;
|
|
|
|
|
|
|
|
/* DNSSEC related options. See information about keys ("Trusted keys", bellow) */
|
|
|
|
|
|
|
|
/* Enable serving of DNSSEC related data - enable on both authoritative
|
|
|
|
and recursive servers DNSSEC aware servers */
|
|
|
|
dnssec-enable yes;
|
|
|
|
|
|
|
|
/* Enable DNSSEC validation on recursive servers */
|
|
|
|
dnssec-validation yes;
|
2010-02-15 16:07:02 +00:00
|
|
|
|
|
|
|
/* Enable DLV by default, use built-in ISC DLV key. */
|
|
|
|
dnssec-lookaside auto;
|
2013-03-19 15:03:18 +00:00
|
|
|
|
2013-10-30 11:41:51 +00:00
|
|
|
/* In Fedora we use /run/named instead of default /var/run/named
|
|
|
|
so we have to configure paths properly. */
|
2013-03-19 15:03:18 +00:00
|
|
|
pid-file "/run/named/named.pid";
|
2013-10-30 11:41:51 +00:00
|
|
|
session-keyfile "/run/named/session.key";
|
2013-05-03 10:55:45 +00:00
|
|
|
|
|
|
|
managed-keys-directory "/var/named/dynamic";
|
2006-03-30 00:52:34 +00:00
|
|
|
};
|
2008-12-01 16:01:44 +00:00
|
|
|
|
2006-03-30 00:52:34 +00:00
|
|
|
logging
|
|
|
|
{
|
|
|
|
/* If you want to enable debugging, eg. using the 'rndc trace' command,
|
|
|
|
* named will try to write the 'named.run' file in the $directory (/var/named).
|
|
|
|
* By default, SELinux policy does not allow named to modify the /var/named directory,
|
|
|
|
* so put the default debug log file in data/ :
|
|
|
|
*/
|
|
|
|
channel default_debug {
|
|
|
|
file "data/named.run";
|
|
|
|
severity dynamic;
|
|
|
|
};
|
|
|
|
};
|
2008-12-01 16:01:44 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
Views let a name server answer a DNS query differently depending on who is asking.
|
|
|
|
|
|
|
|
By default, if named.conf contains no "view" clauses, all zones are in the
|
|
|
|
"default" view, which matches all clients.
|
|
|
|
|
|
|
|
Views are processed sequentially. The first match is used so the last view should
|
|
|
|
match "any" - it's fallback and the most restricted view.
|
|
|
|
|
|
|
|
If named.conf contains any "view" clause, then all zones MUST be in a view.
|
|
|
|
*/
|
|
|
|
|
2006-03-30 00:52:34 +00:00
|
|
|
view "localhost_resolver"
|
|
|
|
{
|
|
|
|
/* This view sets up named to be a localhost resolver ( caching only nameserver ).
|
|
|
|
* If all you want is a caching-only nameserver, then you need only define this view:
|
|
|
|
*/
|
|
|
|
match-clients { localhost; };
|
|
|
|
recursion yes;
|
2008-12-01 16:01:44 +00:00
|
|
|
|
2006-03-30 00:52:34 +00:00
|
|
|
# all views must contain the root hints zone:
|
2008-12-01 16:01:44 +00:00
|
|
|
zone "." IN {
|
|
|
|
type hint;
|
|
|
|
file "/var/named/named.ca";
|
|
|
|
};
|
2006-03-30 00:52:34 +00:00
|
|
|
|
|
|
|
/* these are zones that contain definitions for all the localhost
|
|
|
|
* names and addresses, as recommended in RFC1912 - these names should
|
2008-04-02 12:43:33 +00:00
|
|
|
* not leak to the other nameservers:
|
2006-03-30 00:52:34 +00:00
|
|
|
*/
|
|
|
|
include "/etc/named.rfc1912.zones";
|
|
|
|
};
|
|
|
|
view "internal"
|
|
|
|
{
|
|
|
|
/* This view will contain zones you want to serve only to "internal" clients
|
|
|
|
that connect via your directly attached LAN interfaces - "localnets" .
|
|
|
|
*/
|
2006-06-14 05:26:43 +00:00
|
|
|
match-clients { localnets; };
|
2006-03-30 00:52:34 +00:00
|
|
|
recursion yes;
|
|
|
|
|
2008-12-01 16:01:44 +00:00
|
|
|
zone "." IN {
|
|
|
|
type hint;
|
|
|
|
file "/var/named/named.ca";
|
|
|
|
};
|
2008-04-02 12:43:33 +00:00
|
|
|
|
|
|
|
/* these are zones that contain definitions for all the localhost
|
|
|
|
* names and addresses, as recommended in RFC1912 - these names should
|
|
|
|
* not leak to the other nameservers:
|
|
|
|
*/
|
|
|
|
include "/etc/named.rfc1912.zones";
|
2006-03-30 00:52:34 +00:00
|
|
|
|
|
|
|
// These are your "authoritative" internal zones, and would probably
|
|
|
|
// also be included in the "localhost_resolver" view above :
|
|
|
|
|
2008-12-01 16:01:44 +00:00
|
|
|
/*
|
|
|
|
NOTE for dynamic DNS zones and secondary zones:
|
|
|
|
|
|
|
|
DO NOT USE SAME FILES IN MULTIPLE VIEWS!
|
|
|
|
|
|
|
|
If you are using views and DDNS/secondary zones it is strongly
|
|
|
|
recommended to read FAQ on ISC site (www.isc.org), section
|
|
|
|
"Configuration and Setup Questions", questions
|
|
|
|
"How do I share a dynamic zone between multiple views?" and
|
|
|
|
"How can I make a server a slave for both an internal and an external
|
|
|
|
view at the same time?"
|
|
|
|
*/
|
|
|
|
|
2006-03-30 00:52:34 +00:00
|
|
|
zone "my.internal.zone" {
|
|
|
|
type master;
|
|
|
|
file "my.internal.zone.db";
|
|
|
|
};
|
|
|
|
zone "my.slave.internal.zone" {
|
|
|
|
type slave;
|
|
|
|
file "slaves/my.slave.internal.zone.db";
|
|
|
|
masters { /* put master nameserver IPs here */ 127.0.0.1; } ;
|
|
|
|
// put slave zones in the slaves/ directory so named can update them
|
|
|
|
};
|
|
|
|
zone "my.ddns.internal.zone" {
|
|
|
|
type master;
|
|
|
|
allow-update { key ddns_key; };
|
2008-12-01 16:01:44 +00:00
|
|
|
file "dynamic/my.ddns.internal.zone.db";
|
2006-03-30 00:52:34 +00:00
|
|
|
// put dynamically updateable zones in the slaves/ directory so named can update them
|
|
|
|
};
|
|
|
|
};
|
2008-12-01 16:01:44 +00:00
|
|
|
|
2006-03-30 00:52:34 +00:00
|
|
|
key ddns_key
|
|
|
|
{
|
|
|
|
algorithm hmac-md5;
|
2008-06-02 12:12:39 +00:00
|
|
|
secret "use /usr/sbin/dnssec-keygen to generate TSIG keys";
|
2006-03-30 00:52:34 +00:00
|
|
|
};
|
2008-12-01 16:01:44 +00:00
|
|
|
|
|
|
|
view "external"
|
2006-03-30 00:52:34 +00:00
|
|
|
{
|
|
|
|
/* This view will contain zones you want to serve only to "external" clients
|
2008-04-02 12:43:33 +00:00
|
|
|
* that have addresses that are not match any above view:
|
2006-03-30 00:52:34 +00:00
|
|
|
*/
|
2008-04-02 12:43:33 +00:00
|
|
|
match-clients { any; };
|
2006-03-30 00:52:34 +00:00
|
|
|
|
2008-12-01 16:01:44 +00:00
|
|
|
zone "." IN {
|
|
|
|
type hint;
|
|
|
|
file "/var/named/named.ca";
|
|
|
|
};
|
|
|
|
|
2006-03-30 00:52:34 +00:00
|
|
|
recursion no;
|
|
|
|
// you'd probably want to deny recursion to external clients, so you don't
|
|
|
|
// end up providing free DNS service to all takers
|
|
|
|
|
|
|
|
// These are your "authoritative" external zones, and would probably
|
|
|
|
// contain entries for just your web and mail servers:
|
|
|
|
|
|
|
|
zone "my.external.zone" {
|
|
|
|
type master;
|
|
|
|
file "my.external.zone.db";
|
|
|
|
};
|
|
|
|
};
|
2008-12-01 16:01:44 +00:00
|
|
|
|
|
|
|
/* Trusted keys
|
|
|
|
|
|
|
|
This statement contains DNSSEC keys. If you want DNSSEC aware resolver you
|
|
|
|
have to configure at least one trusted key.
|
|
|
|
|
|
|
|
Note that no key written below is valid. Especially root key because root zone
|
|
|
|
is not signed yet.
|
|
|
|
*/
|
|
|
|
/*
|
|
|
|
trusted-keys {
|
|
|
|
// Root Key
|
|
|
|
"." 257 3 3 "BNY4wrWM1nCfJ+CXd0rVXyYmobt7sEEfK3clRbGaTwSJxrGkxJWoZu6I7PzJu/
|
|
|
|
E9gx4UC1zGAH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