【Linux网络服务器配置、管理与实践】DNS服务器的搭建-0613

安装软件

关闭防火墙和seliux

配置文件

反向解析文件

$TTL 86400

@     IN       SOA     47.168.192.in-addr.arpa.       root.wyl.org (

                                       20180511        ; serial

                                        1H      ; refresh

                                       15M     ; retry

                                        1W      ; expire

                                        1D)    ; minimum

@      IN      NS      dns.wyl.org.

128    IN      PTR     dns.wyl.org.                                                正确格式如下:

120    IN      PTR     www.ttxs.org.(错误,域名应该和dns一样) ttxs.wyl.org.

121    IN      PTR     www.nznd.org.(错误)                              nznd.wyl.org.

122    IN      PTR     www.xxhh.org.(错误)                               xxhh.wyl.org.

正向解析

$TTL 86400

wyl.org.        IN    SOA      dns.wyl.org. root.wyl.org(

                                        20180511        ; serial

                                        1H      ; refresh

                                       15M     ; retry

                                        1W      ; expire

                                        1D)    ; minimum

wyl.org.        IN     NS      dns.wyl.org.

dns             IN      A      192.168.47.128

ttxs            IN      A      192.168.47.120

nznd            IN      A      192.168.47.121

xxhh            IN      A      192.168.47.122

配置文件

options {

       directory       "/var/named";

};

 

zone "wyl.org" {

       type master;

       file "wyl.org";

};

 

zone "47168.192.in-addr.arpa" {

       type master;

       file "47.168.192";

};

问题出错:

6月 05 10:35:23 localhost.localdomain bash[10460]: dns_master_load:146.168.192:2: unexpected end of line

6月 05 10:35:23 localhost.localdomain bash[10460]: dns_master_load:146.168.192:1: unexpected end of input

6月 05 10:35:23 localhost.localdomain bash[10460]: 146.168.192:8: usingRFC1035 TTL semantics

6月 05 10:35:23 localhost.localdomain bash[10460]: zone146.168.192.in-addr.arpa/IN: loading from master file 146.168.192 failed:unexpected end of input

6月 05 10:35:23 localhost.localdomain bash[10460]: zone146.168.192.in-addr.arpa/IN: not loaded due to errors.

6月 05 10:35:23 localhost.localdomain bash[10460]:_default/146.168.192.in-addr.arpa/IN: unexpected end of input

6月 05 10:35:23 localhost.localdomain systemd[1]: named.service:control process exited, code=exited status=1

6月 05 10:35:23 localhost.localdomain systemd[1]: Failed to startBerkeley Internet Name Domain (DNS).

6月 05 10:35:23 localhost.localdomain systemd[1]: Unit named.serviceentered failed state.

6月 05 10:35:23 localhost.localdomain systemd[1]: named.service failed.

解决方案:

1.      排查问题

a)        查看权限:ls -la 146.168.192

b)       运行文件,查看文件状态:systemctlrestart named;

systemctl status named.service

或者查看日志:cat  /var/log/messages

2.      解决问题

反向解析文件出错:把$符号写成s符号

在客户端配置文件:

测试结果:

客户机测试:

[root@localhost ~]# host nznd.wyl.org
nznd.wyl.org has address 192.168.47.121
[root@localhost ~]# host xxhh.wyl.org
xxhh.wyl.org has address 192.168.47.122
[root@localhost ~]# host ttxs.wyl.org

ttxs.wyl.org has address 192.168.47.129

[root@localhost ~]# host 192.168.47.121
121.47.168.192.in-addr.arpa domain name pointer nznd.wyl.org.
[root@localhost ~]# host 192.168.47.122
122.47.168.192.in-addr.arpa domain name pointer xxhh.wyl.org.
[root@localhost ~]# host 192.168.47.129
129.47.168.192.in-addr.arpa domain name pointer ttxs.wyl.org.
[root@localhost ~]# host 192.168.47.128
128.47.168.192.in-addr.arpa domain name pointer dns.wyl.org.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值