Bind9.16实现高可用主从同步问题排错一例

查看Bind的报错日志

[root@masternamed named]# tail -f /var/log/messages
Jan 23 13:53:59 mastermysql bash[2303]: zone 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa/IN: loaded serial 0
Jan 23 13:53:59 mastermysql bash[2303]: zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0
Jan 23 13:53:59 mastermysql bash[2303]: zone 0.in-addr.arpa/IN: loaded serial 0
Jan 23 13:53:59 mastermysql bash[2303]: dns_rdata_fromtext: jin.com.zone:2: near '20240122301': out of range
Jan 23 13:53:59 mastermysql bash[2303]: zone jin.com/IN: loading from master file jin.com.zone failed: out of range
Jan 23 13:53:59 mastermysql bash[2303]: zone jin.com/IN: not loaded due to errors.
Jan 23 13:53:59 mastermysql bash[2303]: _default/jin.com/IN: out of range
Jan 23 13:53:59 mastermysql systemd[1]: named.service: Control process exited, code=exited, status=1/FAILURE
Jan 23 13:53:59 mastermysql systemd[1]: named.service: Failed with result 'exit-code'.
Jan 23 13:53:59 mastermysql systemd[1]: Failed to start Berkeley Internet Name Domain (DNS).
^C
[root@masternamed named]# vim jin.com.zone 

检查配置文件语法

[root@masternamed named]#  named-checkconf 
[root@masternamed named]#  named-checkconf jin.com.zone 
jin.com.zone:1: unknown option '$TTL'
jin.com.zone:17: unexpected token near end of file

named-checkconf 检查的是/etc/named.conf中的Bind主配置文件,要检查zone的配置文件,需要使用named-checkzone指令。

重启BInd服务

[root@masternamed named]# systemctl restart named

Bind常用的检查配置文件和语法的指令如下。

[root@hanyw-bind-m ~]# named-checkconf /etc/named.conf 
[root@hanyw-bind-m ~]# echo $?
0
[root@hanyw-bind-m ~]# 
[root@hanyw-bind-m ~]# named-checkzone hanyw.com /var/named/hanyw.com.zone 
zone hanyw.com/IN: loaded serial 2024012106
OK

你可能感兴趣的:(#,云计算入门,linux,运维,服务器,数据库,bash,云计算)