11.6.1. BIND and SELinux
The default permissions on the /var/named/slaves
,/var/named/dynamic
and /var/named/data
directories allow zone files to be updated via zone transfers and dynamic DNS updates. Files in /var/named
are labeled with the name_zone_t
type, which is used for master zone files.
For a slave server, configure /etc/named.conf
to place slave zones in /var/named/slaves
. The following is an example of a domain entry in /etc/named.conf
for a slave DNS server that stores the zone file for testdomain.com
in /var/named/slaves
:
zone "testdomain.com" {
type slave;
masters { IP-address; };
file "/var/named/slaves/db.testdomain.com";
};
If a zone file is labeled name_zone_t
, the named_write_master_zones
Boolean must be enabled to allow zone transfers and dynamic DNS to update the zone file. Also, the mode of the parent directory has to be changed to allow the named
user or group read, write and execue access.
If zone files in /var/named/
are labeled with name_cache_t
type, a file system relabel or running restorecon -R /var/
will change their type to named_zone_t
.