|
|
854838 |
/*
|
|
|
854838 |
Sample named.conf BIND DNS server 'named' configuration file
|
|
|
854838 |
for the Red Hat BIND distribution.
|
|
|
854838 |
|
|
|
854838 |
See the BIND Administrator's Reference Manual (ARM) for details, in:
|
|
|
854838 |
file:///usr/share/doc/bind-{version}/arm/Bv9ARM.html
|
|
|
854838 |
Also see the BIND Configuration GUI : /usr/bin/system-config-bind and
|
|
|
854838 |
its manual.
|
|
|
854838 |
*/
|
|
|
854838 |
|
|
|
854838 |
options
|
|
|
854838 |
{
|
|
|
854838 |
// Put files that named is allowed to write in the data/ directory:
|
|
|
854838 |
directory "/var/named"; // "Working" directory
|
|
|
854838 |
dump-file "data/cache_dump.db";
|
|
|
854838 |
statistics-file "data/named_stats.txt";
|
|
|
854838 |
memstatistics-file "data/named_mem_stats.txt";
|
|
|
854838 |
secroots-file "data/named.secroots";
|
|
|
854838 |
recursing-file "data/named.recursing";
|
|
|
854838 |
|
|
|
854838 |
|
|
|
854838 |
/*
|
|
|
854838 |
Specify listenning interfaces. You can use list of addresses (';' is
|
|
|
854838 |
delimiter) or keywords "any"/"none"
|
|
|
854838 |
*/
|
|
|
854838 |
//listen-on port 53 { any; };
|
|
|
854838 |
listen-on port 53 { 127.0.0.1; };
|
|
|
854838 |
|
|
|
854838 |
//listen-on-v6 port 53 { any; };
|
|
|
854838 |
listen-on-v6 port 53 { ::1; };
|
|
|
854838 |
|
|
|
854838 |
/*
|
|
|
854838 |
Access restrictions
|
|
|
854838 |
|
|
|
854838 |
There are two important options:
|
|
|
854838 |
allow-query { argument; };
|
|
|
854838 |
- allow queries for authoritative data
|
|
|
854838 |
|
|
|
854838 |
allow-query-cache { argument; };
|
|
|
854838 |
- allow queries for non-authoritative data (mostly cached data)
|
|
|
854838 |
|
|
|
854838 |
You can use address, network address or keywords "any"/"localhost"/"none" as argument
|
|
|
854838 |
Examples:
|
|
|
854838 |
allow-query { localhost; 10.0.0.1; 192.168.1.0/8; };
|
|
|
854838 |
allow-query-cache { ::1; fe80::5c63:a8ff:fe2f:4526; 10.0.0.1; };
|
|
|
854838 |
*/
|
|
|
854838 |
|
|
|
854838 |
allow-query { localhost; };
|
|
|
854838 |
allow-query-cache { localhost; };
|
|
|
854838 |
|
|
|
854838 |
/* Enable/disable recursion - recursion yes/no;
|
|
|
854838 |
|
|
|
854838 |
- If you are building an AUTHORITATIVE DNS server, do NOT enable recursion.
|
|
|
854838 |
- If you are building a RECURSIVE (caching) DNS server, you need to enable
|
|
|
854838 |
recursion.
|
|
|
854838 |
- If your recursive DNS server has a public IP address, you MUST enable access
|
|
|
854838 |
control to limit queries to your legitimate users. Failing to do so will
|
|
|
854838 |
cause your server to become part of large scale DNS amplification
|
|
|
854838 |
attacks. Implementing BCP38 within your network would greatly
|
|
|
854838 |
reduce such attack surface
|
|
|
854838 |
*/
|
|
|
854838 |
recursion yes;
|
|
|
854838 |
|
|
|
854838 |
/* DNSSEC related options. See information about keys ("Trusted keys", bellow) */
|
|
|
854838 |
|
|
|
854838 |
/* Enable DNSSEC validation on recursive servers */
|
|
|
854838 |
dnssec-validation yes;
|
|
|
854838 |
|
|
|
854838 |
/* In Fedora we use /run/named instead of default /var/run/named
|
|
|
854838 |
so we have to configure paths properly. */
|
|
|
854838 |
pid-file "/run/named/named.pid";
|
|
|
854838 |
session-keyfile "/run/named/session.key";
|
|
|
854838 |
|
|
|
854838 |
managed-keys-directory "/var/named/dynamic";
|
|
|
854838 |
|
|
|
854838 |
/* In Fedora we use system-wide Crypto Policy */
|
|
|
854838 |
/* https://fedoraproject.org/wiki/Changes/CryptoPolicy */
|
|
|
854838 |
include "/etc/crypto-policies/back-ends/bind.config";
|
|
|
854838 |
};
|
|
|
854838 |
|
|
|
854838 |
logging
|
|
|
854838 |
{
|
|
|
854838 |
/* If you want to enable debugging, eg. using the 'rndc trace' command,
|
|
|
854838 |
* named will try to write the 'named.run' file in the $directory (/var/named).
|
|
|
854838 |
* By default, SELinux policy does not allow named to modify the /var/named directory,
|
|
|
854838 |
* so put the default debug log file in data/ :
|
|
|
854838 |
*/
|
|
|
854838 |
channel default_debug {
|
|
|
854838 |
file "data/named.run";
|
|
|
854838 |
severity dynamic;
|
|
|
854838 |
};
|
|
|
854838 |
};
|
|
|
854838 |
|
|
|
854838 |
/*
|
|
|
854838 |
Views let a name server answer a DNS query differently depending on who is asking.
|
|
|
854838 |
|
|
|
854838 |
By default, if named.conf contains no "view" clauses, all zones are in the
|
|
|
854838 |
"default" view, which matches all clients.
|
|
|
854838 |
|
|
|
854838 |
Views are processed sequentially. The first match is used so the last view should
|
|
|
854838 |
match "any" - it's fallback and the most restricted view.
|
|
|
854838 |
|
|
|
854838 |
If named.conf contains any "view" clause, then all zones MUST be in a view.
|
|
|
854838 |
*/
|
|
|
854838 |
|
|
|
854838 |
view "localhost_resolver"
|
|
|
854838 |
{
|
|
|
854838 |
/* This view sets up named to be a localhost resolver ( caching only nameserver ).
|
|
|
854838 |
* If all you want is a caching-only nameserver, then you need only define this view:
|
|
|
854838 |
*/
|
|
|
854838 |
match-clients { localhost; };
|
|
|
854838 |
recursion yes;
|
|
|
854838 |
|
|
|
854838 |
# all views must contain the root hints zone:
|
|
|
854838 |
zone "." IN {
|
|
|
854838 |
type hint;
|
|
|
854838 |
file "/var/named/named.ca";
|
|
|
854838 |
};
|
|
|
854838 |
|
|
|
854838 |
/* these are zones that contain definitions for all the localhost
|
|
|
854838 |
* names and addresses, as recommended in RFC1912 - these names should
|
|
|
854838 |
* not leak to the other nameservers:
|
|
|
854838 |
*/
|
|
|
854838 |
include "/etc/named.rfc1912.zones";
|
|
|
854838 |
};
|
|
|
854838 |
view "internal"
|
|
|
854838 |
{
|
|
|
854838 |
/* This view will contain zones you want to serve only to "internal" clients
|
|
|
854838 |
that connect via your directly attached LAN interfaces - "localnets" .
|
|
|
854838 |
*/
|
|
|
854838 |
match-clients { localnets; };
|
|
|
854838 |
recursion yes;
|
|
|
854838 |
|
|
|
854838 |
zone "." IN {
|
|
|
854838 |
type hint;
|
|
|
854838 |
file "/var/named/named.ca";
|
|
|
854838 |
};
|
|
|
854838 |
|
|
|
854838 |
/* these are zones that contain definitions for all the localhost
|
|
|
854838 |
* names and addresses, as recommended in RFC1912 - these names should
|
|
|
854838 |
* not leak to the other nameservers:
|
|
|
854838 |
*/
|
|
|
854838 |
include "/etc/named.rfc1912.zones";
|
|
|
854838 |
|
|
|
854838 |
// These are your "authoritative" internal zones, and would probably
|
|
|
854838 |
// also be included in the "localhost_resolver" view above :
|
|
|
854838 |
|
|
|
854838 |
/*
|
|
|
854838 |
NOTE for dynamic DNS zones and secondary zones:
|
|
|
854838 |
|
|
|
854838 |
DO NOT USE SAME FILES IN MULTIPLE VIEWS!
|
|
|
854838 |
|
|
|
854838 |
If you are using views and DDNS/secondary zones it is strongly
|
|
|
854838 |
recommended to read FAQ on ISC site (www.isc.org), section
|
|
|
854838 |
"Configuration and Setup Questions", questions
|
|
|
854838 |
"How do I share a dynamic zone between multiple views?" and
|
|
|
854838 |
"How can I make a server a slave for both an internal and an external
|
|
|
854838 |
view at the same time?"
|
|
|
854838 |
*/
|
|
|
854838 |
|
|
|
854838 |
zone "my.internal.zone" {
|
|
|
854838 |
type master;
|
|
|
854838 |
file "my.internal.zone.db";
|
|
|
854838 |
};
|
|
|
854838 |
zone "my.slave.internal.zone" {
|
|
|
854838 |
type slave;
|
|
|
854838 |
file "slaves/my.slave.internal.zone.db";
|
|
|
854838 |
masters { /* put master nameserver IPs here */ 127.0.0.1; } ;
|
|
|
854838 |
// put slave zones in the slaves/ directory so named can update them
|
|
|
854838 |
};
|
|
|
854838 |
zone "my.ddns.internal.zone" {
|
|
|
854838 |
type master;
|
|
|
854838 |
allow-update { key ddns_key; };
|
|
|
854838 |
file "dynamic/my.ddns.internal.zone.db";
|
|
|
854838 |
// put dynamically updateable zones in the slaves/ directory so named can update them
|
|
|
854838 |
};
|
|
|
854838 |
};
|
|
|
854838 |
|
|
|
854838 |
key ddns_key
|
|
|
854838 |
{
|
|
|
854838 |
algorithm hmac-sha256;
|
|
|
854838 |
secret "use /usr/sbin/ddns-confgen to generate TSIG keys";
|
|
|
854838 |
};
|
|
|
854838 |
|
|
|
854838 |
view "external"
|
|
|
854838 |
{
|
|
|
854838 |
/* This view will contain zones you want to serve only to "external" clients
|
|
|
854838 |
* that have addresses that are not match any above view:
|
|
|
854838 |
*/
|
|
|
854838 |
match-clients { any; };
|
|
|
854838 |
|
|
|
854838 |
zone "." IN {
|
|
|
854838 |
type hint;
|
|
|
854838 |
file "/var/named/named.ca";
|
|
|
854838 |
};
|
|
|
854838 |
|
|
|
854838 |
recursion no;
|
|
|
854838 |
// you'd probably want to deny recursion to external clients, so you don't
|
|
|
854838 |
// end up providing free DNS service to all takers
|
|
|
854838 |
|
|
|
854838 |
// These are your "authoritative" external zones, and would probably
|
|
|
854838 |
// contain entries for just your web and mail servers:
|
|
|
854838 |
|
|
|
854838 |
zone "my.external.zone" {
|
|
|
854838 |
type master;
|
|
|
854838 |
file "my.external.zone.db";
|
|
|
854838 |
};
|
|
|
854838 |
};
|
|
|
854838 |
|
|
|
854838 |
/* Trusted keys
|
|
|
854838 |
|
|
|
854838 |
This statement contains DNSSEC keys. If you want DNSSEC aware resolver you
|
|
|
854838 |
should configure at least one trusted key.
|
|
|
854838 |
|
|
|
854838 |
Note that no key written below is valid. Especially root key because root zone
|
|
|
854838 |
is not signed yet.
|
|
|
854838 |
*/
|
|
|
854838 |
/*
|
|
|
854838 |
trust-anchors {
|
|
|
854838 |
// Root Key
|
|
|
854838 |
. initial-key 257 3 8 "AwEAAaz/tAm8yTn4Mfeh5eyI96WSVexTBAvkMgJzkKTOiW1vkIbzxeF3
|
|
|
854838 |
+/4RgWOq7HrxRixHlFlExOLAJr5emLvN7SWXgnLh4+B5xQlNVz8Og8kv
|
|
|
854838 |
ArMtNROxVQuCaSnIDdD5LKyWbRd2n9WGe2R8PzgCmr3EgVLrjyBxWezF
|
|
|
854838 |
0jLHwVN8efS3rCj/EWgvIWgb9tarpVUDK/b58Da+sqqls3eNbuv7pr+e
|
|
|
854838 |
oZG+SrDK6nWeL3c6H5Apxz7LjVc1uTIdsIXxuOLYA4/ilBmSVIzuDWfd
|
|
|
854838 |
RUfhHdY6+cn8HFRm+2hM8AnXGXws9555KrUB5qihylGa8subX2Nn6UwN
|
|
|
854838 |
R1AkUTV74bU=";
|
|
|
854838 |
|
|
|
854838 |
// Key for forward zone
|
|
|
854838 |
example.com. static-key 257 3 8 "AwEAAZ0aqu1rJ6orJynrRfNpPmayJZoAx9Ic2/Rl9VQW
|
|
|
854838 |
LMHyjxxem3VUSoNUIFXERQbj0A9Ogp0zDM9YIccKLRd6
|
|
|
854838 |
LmWiDCt7UJQxVdD+heb5Ec4qlqGmyX9MDabkvX2NvMws
|
|
|
854838 |
UecbYBq8oXeTT9LRmCUt9KUt/WOi6DKECxoG/bWTykrX
|
|
|
854838 |
yBR8elD+SQY43OAVjlWrVltHxgp4/rhBCvRbmdflunaP
|
|
|
854838 |
Igu27eE2U4myDSLT8a4A0rB5uHG4PkOa9dIRs9y00M2m
|
|
|
854838 |
Wf4lyPee7vi5few2dbayHXmieGcaAHrx76NGAABeY393
|
|
|
854838 |
xjlmDNcUkF1gpNWUla4fWZbbaYQzA93mLdrng+M=";
|
|
|
854838 |
|
|
|
854838 |
|
|
|
854838 |
// Key for reverse zone.
|
|
|
854838 |
2.0.192.IN-ADDRPA.NET. initial-ds 31406 8 2 "F78CF3344F72137235098ECBBD08947C2C9001C7F6A085A17F518B5D8F6B916D";
|
|
|
854838 |
};
|
|
|
854838 |
*/
|