Create a DNS server using BIND on linux

Source: Internet
Author: User
Article Title: use BIND to create a DNS server on linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

Although Linux has not made any notable progress in the world of desktop computing, It is very famous as a network server. Thanks to its excellent reliability, we can safely run all kinds of important service programs necessary for the Internet era on Linux. As a result, the most common use of Linux includes the use of mail servers, Web servers, and DNS servers.

Next we will study how to create a DNS server using BIND on Red Hat Linux. BIND (Berkeley Internet Name Domain) is a Domain Name resolution service package implemented on UNIX/Linux systems. We will learn the installation, initial configuration, and system settings required to establish and run a DNS server on Linux.

In this article, we use Red Hat as an example, so you may want to use the RPM version of BIND, you can find it by searching www.rpmfind.net, the RPM release package is the easiest way to install BIND. After downloading the RPM for BIND, such as the bind-9.1.0-10.i386.rpm, You need to execute the rpm-ivh bind-9.1.0-10.i386.rpm command as a superuser. When installing BIND with RPM, check for any missing dependencies that may cause installation failure.

If you prefer to install the source code package, run the tar xvfz bind-9.1.3.tar.gz command as a superuser to decompress it after you download a file such as bind-9.1.3.tar.gz. In this example, a directory named bind-9.1.3 is generated, which contains all the files necessary for installation. Next, go to the newly created directory and execute the./configure command. After the script completes all the configuration work, run make, and then run make install to complete the installation process. Now you should have installed the basic configuration BIND in your system, and then adjust it as needed.

Configure BIND

After BIND is installed in the system, you can configure it in multiple ways. One of the two most common methods is to use ISP-type settings. The DNS Server accepts and resolves requests from anyone (or a set of pre-defined users), and the other is the Web host mode, the server only parses requests to the service domain name. When the purpose of the server changes, you can change the configuration type at any time.

The DNS server can be either a master server or a secondary server. The master server, also known as the master server, is the final source for determining domain names. The master server is also the source of zone transfer to the secondary server. The secondary server receives information from all zones of the master server. A common mistake is to try to change the zone database file on the second-level server without changing the zone file on the master server ). Why do we need two servers? It is a good idea to use redundancy in any configuration, which is a native part of BIND and DNS. Fortunately, adding a second Linux server as a secondary DNS server in the IDC will not affect your budget.

Remember that when there are two types of servers, the master server can also serve as a secondary server for other domains. In most ISP environments, you can see this situation. The customer has its own master DNS server and uses the ISP as a secondary server for backup purposes. This type of configuration and almost all other configuration items in BIND are completed through the named. conf file. This file stores server information and zone information in plain text. See Table.

Named. conf file example

Options {

Y-source 10.0.0.2;

Pid-file "/var/run/named. pid ";

};

Zone "."{

Type master;

File "root. db ";

};

Zone "example.com "{

Type master;

File "/var/named/sample.com. zone ";

};

The DNS server has a variety of available options. If you need a special installation method, I suggest you read the attached documents. In the preceding example, notify-source specifies the place where the server sends the NOTIFY y message, this message is sent to the secondary server when the master server detects changes to the zone database file. The pid-file option only tells the daemon server the path to write ID information, usually/var/run/named. pid, but you can change the directory layout as needed.

[1] [2] [3] Next page

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.