Easy to build a DNS server under Linux

Source: Internet
Author: User
Tags bind versions nameserver linux

Frequent internet friends may often go to Sina, Sohu and other large websites, only need to enter their web site in the browser to achieve access, it seems very simple, but technically speaking, but contains a complex process: in the Web page, first in the browser input site domain name, Then the browser will be based on the local DNS server settings will be entered into the site domain name to the corresponding IP address, and then to the IP corresponding server request data, and finally the requested data through the browser display. The most important aspect of this process is the conversion from domain name to IP address, which is done by DNS server.

I. Overview of DNS Services

DNS is the abbreviation of Domain Name System, which is the DNS server, the primary function of the DNS service is to convert the domain name to the corresponding IP address, and the system that provides DNS service.

DNS servers can be divided into 3 types, primary domain name servers (master DNS), secondary domain name servers (Slave DNS), and cache servers (cache-only server).

Master DNS, which itself provides DNS services, and itself contains zone data files.

Slave DNS, together with master, provides DNS services that are automatically updated to Slave servers when configuration information is modified on the master server.

Cache-only server, which does not have its own zone data file, simply helps clients to request queries from external DNS, and then saves the results that are found in its cache.

The functionality of the DNS service under Linux is implemented through the BIND software, and almost every Linux distribution has its own DNS service software, and the following details the installation, configuration, and use of the DNS service.

Second, the establishment of DNS services

Here we describe the environment as:

Operating system: Red Hat Enterprise Linux Server Release 5

Bind software version: System with bind-9.3.4

1. Installing the BIND software

Installing bind under the RHEL5 system requires the installation of Bind-utils, Bind-chroot, Ypbind, Bind-libs, Caching-nameserver, and several packages that support bind. Check that the system is properly installed with the BIND software, and execute the following command:

[Root@localhost ~]# Rpm-qa |grep bind

Bind-libs-9.3.4-6.0.2.p1.el5_2

Bind-utils-9.3.4-6.0.2.p1.el5_2

Bind-chroot-9.3.4-6.0.2.p1.el5_2

Ypbind-1.19-8.el5

Bind-9.3.4-6.0.2.p1.el5_2

[Root@localhost ~]# Rpm-qa |grep caching-nameserver

Caching-nameserver-9.3.4-6.0.2.p1.el5_2

Several of the above packages can be found from the system installation CD, if not installed or missing some packages, please do the installation by RPM, here is not too much to tell.

If your system supports Yum automatic upgrades, you can complete the installation automatically by executing the following command:

[root@localhost ~] #yum Install bind Caching-nameserver

2. Configuring the DNS Service

The BIND software uses chroot technology in the Rhel 5 version, unlike other Linux versions, such as the core profile named.conf without the DNS service and any zone data files, and the path to the installer is different from the other versions. However, these do not affect our DNS configuration, the following is the first to describe the installation directory structure of BIND under RHEL5.

Bind installed, the main program directory defaults to/var/named, Because there is no named.conf file after the bind defaults under Rhel5, and we installed the Caching-nameserver package above, this package provides the initialization template file for bind rhel5 under, so/var/named/chroot/ ETC is the core configuration file directory for DNS, and the/var/named/chroot/var/named directory is the location of the system's own zone data file and its own locale data file.

(1) named.conf documents detailed

Here we construct the named.conf file from the initialization template file that the system provides to bind.

[root@localhost ~] #cd/var/named/chroot/etc

[Root@localhost etc]# CP named.rfc1912.zones named.conf

[root@localhost etc] #chown root:named named.conf

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.