Monday, January 17, 2011

Локальный кэширующий DNS сервер

Необходим для Астериска, ибо при пропадании канала при очередном DNS Lookup может зависнуть.

apt-get install bind9
vi /etc/bind/named.conf.options

acl "corpnets" {192.168.240.0/24; 127.0.0.1/8; localhost;}; //Тут прописать диапазон сетей, которые могут обращаться к нашему серверу
options {
directory "/var/cache/bind";

// If there is a firewall between you and nameservers you want
// to talk to, you may need to fix the firewall to allow multiple
// ports to talk. See http://www.kb.cert.org/vuls/id/800113

// If your ISP provided one or more IP addresses for stable
// nameservers, you probably want to use them as forwarders.
// Uncomment the following block, and insert the addresses replacing
// the all-0's placeholder.

allow-query {"corpnets";};

forwarders {
8.8.8.8; // Тут прописать корневой DNS сервер
};

auth-nxdomain no; # conform to RFC1035
listen-on-v6 { any; };
};

/etc/init.d/bind9 restart
vi /etc/resolv.conf

nameserver 127.0.0.1

Все. Наслаждаемся локальным DNS.