Пример настройки сервера BIND 9


dns  bind  centos  linux  fedora 
Ответы

Установка

CentOS 7

yum -y install bind-utils bind

Файл named.conf

options {
   directory   "/var/named";
   dump-file   "/var/named/data/cache_dump.db";
   statistics-file "/var/named/data/named_stats.txt";
   memstatistics-file "/var/named/data/named_mem_stats.txt";

   disable-empty-zone "255.255.255.255.IN-ADDR.ARPA";
   disable-empty-zone "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA";
   disable-empty-zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA";

   forwarders {
       77.88.8.8;
       8.8.8.8;
   };

   listen-on {
       10.0.0.10;
       127.0.0.1;
   };
};

logging {
   channel "misc" {
       file "/var/log/named/misc.log" versions 4 size 4m;
       print-time YES;
       print-severity YES;
       print-category YES;
   };

   channel "query" {
       file "/var/log/named/query.log" versions 4 size 4m;
       print-time YES;
       print-severity NO;
       print-category NO;
   };

   category default {
       "misc";
   };

   category queries {
       "query";
   };
};

include "/etc/named/named.internal";
include "/etc/named/named.external";

Файл named.internal

view "internal" {
   match-clients {
       10.0.0.0/8;
       127.0.0.1/32;
   };
   allow-query {
       any;
   };
   auth-nxdomain yes;
   recursion yes;
   include "/etc/named/standart.zone";
   include "/etc/named/block.zone";
   include "/etc/named/valid.zones";
   include "/etc/named/ddns.key";
   zone "0.0.10.in-addr.arpa" {
       type master;
       file "/etc/named/10.0.0.rev";
       allow-update { key DHCP_UPDATER; };
   };
   zone "remizoffalex.ru." {
       type master;
       file "/etc/named/remizoffalex.ru.int";
       allow-update { key DHCP_UPDATER; };
   };
   zone "specialistoff.net." {
       type master;
       file "/etc/named/specialistoff.net.int";
   };
   zone "local." {
       type master;
       file "/etc/named/local.int";
   };
};

Файл named.external

view "external" {
       match-clients {
               any;
       };
       recursion no;
       include "/etc/named/standart.zone";
       zone "remizoffalex.ru" {
               type master;
               file "/etc/named/remizoffalex.ru.ext";
       };
       zone "specialistoff.net" {
               type master;
               file "/etc/named/specialistoff.net.ext";
       };
};