Для ограничения доступа введем ACL, описывающую нашу локальную сеть:
ACL_MY 192.168.0.0/24
Разрешаем пересылки с зоны none, т.е. никому не разрешаем и разрешаем запросы только с alc_my
Конфигурационные файлы:
/etc/bind/named.conf
/etc/bind/named.conf.options
#start ----------/etc/bind/named.conf.options
options {
directory "/var/cache/bind";
auth-nxdomain no; # conform to RFC1035
listen-on-v6 { any; };
forwarders {
195.55.55.56; #внешний DNS-провайдера, которому перенаправляются запросы
212.55.55.56; #внешний DNS-провайдера, которому перенаправляются запросы
};
allow-transfer {
none;
};
allow-query {
acl_my; #запросы только из локальной сети
};
};
#end ----------/etc/bind/named.conf.options
#start ----------/etc/bind/named.conf
acl ACL_MY {
192.168.0.0/24;
};
// This is the primary configuration file for the BIND DNS server named.
//
// Please read /usr/share/doc/bind9/README.Debian.gz for information on the
// structure of BIND configuration files in Debian, *BEFORE* you customize
// this configuration file.
//
// If you are just adding zones, please do that in /etc/bind/named.conf.local
include "/etc/bind/named.conf.options";
// prime the server with knowledge of the root servers
zone "." {
type hint;
file "/etc/bind/db.root";
};
// be authoritative for the localhost forward and reverse zones, and for
// broadcast zones as per RFC 1912
zone "localhost" {
type master;
file "/etc/bind/db.local";
};
zone "127.in-addr.arpa" {
type master;
file "/etc/bind/db.127";
};
zone "0.in-addr.arpa" {
type master;
file "/etc/bind/db.0";
};
zone "255.in-addr.arpa" {
type master;
file "/etc/bind/db.255";
};
include "/etc/bind/named.conf.local";
#end ----------/etc/bind/named.conf