BIND/Guide/ru

This guide will teach you how install and configure BIND for your domain and your local network.

Introduction
This tutorial will show you how to install and configure BIND, the most used DNS server on Internet. We will configure  for your domain using different configurations, one for your local network and one for the rest of the world. We will use views to do that. One view for your internal zone (your local network) and other view for the external zone (rest of the world).

Installation
First, install.

Configuring /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

Finishing configuration
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