DNS configuration under Linux

Course Title

Server configuration and management

experiment

score

 

Experiment name

DNS server configuration

student ID

 

Name

 

class

 

date

 

Purpose:

1. Master the basic commands of the linux system

2 Master the principle of DNS

3. Master the installation and configuration method of liunx enterprise version DNS server and client

experiment platform:

  cloud platform

1. Experiment content

Configure the DNS server and client to complete DNS resolution.

2. Server-side settings

1. Configure the network card, and configure the DNS server address in the network card.

2. View on the server and install the bind server software package.

 [root@localhost ~]# rpm -qa|grep bind

bind-libs-9.9.4-29.el7.x86_64

bind -9.9.4-29.el7.x86_64

3. Modify the /etc/named.conf configuration file and add the forward zone "sh.com". The result is as follows:

   

 4. Exit the vi editor and use the named-checkconf command to check the configuration file

[root@localhost Packages]# named-checkconf  /etc/named.conf

 

 5. Configure the sh.com.hosts forward parsing file, you can copy the template to modify.

[root@localhost ~]#cp  /var/named/named.localhost  /var/named/sh.com.hosts

[root@localhost ~]# vi  /var/named/sh.com.hosts

 

7. Use named-checkzone to check the forward direction and whether the zone configuration is wrong

[root@localhost ~]# named-checkzone sh.com /var/named/sh.com.hosts

appear

zone sh.com/IN: loaded serial 0

OK

显示为OK则配置没有问题

 

8、启动服务

[root@localhost ~]# systemctl start named.service

[root@localhost ~]# systemctl status named.service

二、客户端设置

使用host命令检查是否能够解析,如果解析成功,如图所示。

 

三、需要注意的问题:

  1、不能启动named程序,出现错误

[root@localhost ~]# systemctl start named.service

Job for smb.service failed because the control process exited with error code. See "systemctl status named.service" and "journalctl -xe" for details.

 

解决办法:1、使用testparm检查配置文件,

1、        查看第二行有没有多一个@.

2、        下面解析所有行都顶格

3、        域名后面要有个”.”

 

 2、如果host 命令出错

 

 (1)关闭防火墙: #systemctl stop firewalld. 

               

(2)修改正向和反向区域文件权限。

Chmod –R  757 /var/named/sh.com.hosts

        

(3)重启DNS服务   

 

 

  

实验总结(结论或问题分析):

 

 

 

DNS与IP一致

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324816017&siteId=291194637