RHEL7 set up and configuration of DNS service

DNS Domain Name Service

Compared to IP addresses, domain names consisting of numbers easier to understand and remember, we are often more accustomed to access network resources through the domain name. However, only between computers on the network based on IP address to recognize each other's identity, but also in order to transmit data over the Internet it must also be based on the IP address of the external network to complete.
In order to reduce the threshold of user access to network resources, DNS (Domain Name System, the domain name system) technology came into being. This is a used to manage and resolve domain names and IP addresses corresponding to the relationship between technology, simply put, is able to accept the domain name or IP address of the user input, then automatically find a match (or that has a mapping relation) or IP address domain name, the domain name is about to be resolved to an IP address (analytical positive), or domain name resolves to the IP address (reverse lookup). As a result, we only need to enter the domain name in the browser can open the site you want to access. DNS name resolution technology being analytical mode of operation is what we use most often.
Given the Internet's domain name and IP address correspondence database is too large, DNS DNS service uses a hierarchical tree structure similar to record correspondence between domain names and IP addresses, thus forming a distributed database system.

These are the brief period of the DNS domain name resolution services, I will use the following example describes how to set up a DNS service

Here Insert Picture Description
Environmental parameters:

host ip
server1 192.168.10.1/24
server2 192.168.10.2/24
desktop 192.168.10.3/24

First, you need to configure a yum source, you can take a look at my article configuration centos-yum source , I will not go into details.

Bind installation service program

yum install -y bind*

Brief bind service program

Configuration bind service program is not simple, because in order to provide users with robust DNS queries to be saved locally relevant domain name database, and if the mapping between domain names and IP addresses are written to a configuration file , we have estimated the parameters of ten million, so that is not conducive to the performance of programs, nor to facilitate future modifications and maintenance. So has the following three more crucial documents bind service program.

主配置文件(/etc/named.conf):只有58行,而且在去除注释信息和空行之后,实际有效的参数仅有30行左右,这些参数用来定义bind服务程序的运行。
区域配置文件(/etc/named.rfc1912.zones):用来保存域名和IP地址对应关系的所在位置。类似于图书的目录,对应着每个域和相应IP地址所在的具体位置,当需要查看或修改时,可根据这个位置找到相关文件。
数据配置文件目录(/var/named):该目录用来保存域名和IP地址真实对应关系的数据配置文件。

Edit the main configuration file
vim /etc/named.conf
before modifying
Here Insert Picture Description
modify the first row and 13 rows {21} content to any, the comment line 14
as shown in FIG

Here Insert Picture Description
save out
and edit the profile region (/etc/named.rfc1912.zones)

vim /etc/named.rfc1912.zones

Regional Profile bind service program (/etc/named.rfc1912.zones) to hold the domain name and IP address corresponding to the location relations. In this file, we define the domain name and IP address resolution to save the rule file location and type of service content, but does not contain a specific domain name, IP address correspondence information relations. There are three service types, namely hint (root region), master (main area), slave (auxiliary area), which commonly refers to the master and slave master and slave. The domain name to an IP address resolution parameters and forward the IP address resolves to the reverse domain name resolution parameters shown below
Here Insert Picture Description
(Tips: from https://www.linuxprobe.com/)
Here Insert Picture Description
remove the first, third , fifth, leaving the second and fourth
Here Insert Picture Description
, as shown below
Here Insert Picture Description
edit the following figure
Here Insert Picture Description
to save and exit
the last to enter data configuration file directory
cd /var/named
** ** bold style described here Insert Picture
cp -a named.localhost runtime.local
cp -a named.loopback runtime.zone
editor forward zone file
vim runtime.local
Here Insert Picture Description
save and exit
and then edit the reverse zone file
vim runtime.zone
Here Insert Picture Description
the final restart service
systemctl restart named
added to the boot from the start
systemctl enable named


Tested on system1
Here Insert Picture Description
tested on system2 ( PS: need to system1, system2 and desktop ip address of the dns to the system1 )
Here Insert Picture Description
tested on the desktop
Here Insert Picture Description
Prefect !!!
now install apache service on a test system1

yum install -y httpd
Here Insert Picture Description


Whether the test can be resolved using system2

Here Insert Picture Description


Use desktop test

Here Insert Picture Description


After words

Well, RHEL7 set up and configuration under DNS service here is over, you have any idea, then you can comment below, due to the limited level, in many places is certainly some shortcomings, if any flaws or mistakes, please correct me, certainly improved. Article writing is not easy, everyone's comments and thumbs is my greatest motivation, thank you support!

Released nine original articles · won praise 38 · views 10000 +

Guess you like

Origin blog.csdn.net/gd_9988/article/details/104063221