DNS服务器systemctl start named启动失败
systemctl restart? named
Job for named.service failed because the control process exited with error code. See "systemctl status named.service" and "journalctl -xe" for details.
命令:named-checkconf -z /etc/named.conf
zone linuxprobe.com/IN: NS 'ns.linuxprobe.com.linuxprobe.com' has no address records (A or AAAA)
zone linuxprobe.com/IN: not loaded due to errors.??// 沒有指定A記錄導致出錯
在 /usr/lib/systemd/system/named.service 中定義了一行:
ExecStartPre=/bin/bash -c 'if [ ! "$DISABLE_ZONE_CHECKING" == "yes" ];
then /usr/sbin/named-checkconf -z "$NAMEDCONF";
else echo "Checking of zone files is disabled"; fi'
就是因為啟動?named 前會檢查?named-checkconf -z /etc/named.conf ,回應?exit 1,所以啟動失敗
解決方式
1. 直接用 named -u named 啟動,如果要習慣 systemctl restart named.service啟動的話,就不要這么做了,只是暫時。
2. 改寫 ExecStartPre 檢查方式,讓它 exit 0
3.注解ExecStartPre 不檢查 zone
4. 或在 /etc/sysconfig/named 加入 DISABLE_ZONE_CHECKING=”yes”,并確認 named.service 文檔里的 EnvironmentFile 是不是長這樣: EnvironmentFile=/etc/sysconfig/named,我剛看時是長這樣: EnvironmentFile=-/etc/sysconfig/named (多了 – dash)。改了 named.service 后要 systemctl daemon-reload
?
總結
以上是生活随笔為你收集整理的DNS服务器systemctl start named启动失败的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: FFmpeg再学习 -- FFmpeg解
- 下一篇: JAVA面试题(126~170)《下》