BIND/Guide/ru

Данная статья научит вас, как устанавливать и конфигурировать BIND для вашего домена и вашей локальной сети.

Введение
Данный учебник покажет вам, как устанавливать и конфигурировать BIND, самый частоиспользуемый DNS-сервер в Интернет. Мы сконфигурируем  для вашего домена, используя различные конфигурации, одну для вашей локальной сети, и одну для остального мира. Для этого мы будем использовать виды (views). Один вид для вашей внутренней зоны (вашей локальной сети) и другой вид для внешней зоны (остального мира).

Установка
Сначала, установите.

Настройка /etc/bind/named.conf
The first thing to configure is. The first part of this step is specifying bind's root directory, the listening port with the IPs, the pid file, and a line for ipv6 protocol.

options section

The second part of is the internal view used for our local network.

Internal view

The third part of is the external view used to resolve our domain name for the rest of the world and to resolve all other domain names for us (and anyone who wants to use our DNS server).

External view

The final part of is the logging policy.

External view

The directory must be exist and belong to   :

Creating the internal zone file
We use the hostnames and IP adresses of the picture network example. Note that almost all (not all) domain names finish with "." (dot).

/var/bind/pri/YOUR_DOMAIN.internal

Creating the external zone file
Here we only have the subdomains we want for external clients (www, mail and ns).

/var/bind/pri/YOUR_DOMAIN.external

Оканчиваем конфигурацию
You'll need to add  to the default runlevel:

Configuring clients
Now you can use your own DNS server in all machines of your local network to resolve domain names. Modify the file of all machines of your local network.

Editing /etc/resolv.conf

Note that YOUR_DNS_SERVER_IP is the same as YOUR_LOCAL_IP we used in this document. In the picture the example is 192.168.1.5.

Testing
We are able to test our new DNS server. First, we need to start the service.

Now, we are going to make some  commands to some domains. We can use any computer of our local network to do this test. If you don't have  installed you can use   instead. Otherwise, first run.

Protecting the server with iptables
If you use iptables to protect your server, you can add these rules for DNS service.

Iptables rules

Acknowledgements
We would like to thank the following authors and editors for their contributions to this guide:


 * Vicente Olivert Riera
 * nightmorph