Domain-Name-System

DNS Named.service isc_stdio_open ‘data/named.run’ 失敗:權限被拒絕

  • April 28, 2017

大家好,我在啟動 systemctl named.service 時遇到問題

我試圖安裝綁定並配置所有內容以使公共域名正常工作,但我遇到了這個問題。

systemctl status named.service

我得到這個錯誤

   ● named.service - Berkeley Internet Name Domain (DNS)
  Loaded: loaded (/usr/lib/systemd/system/named.service; enabled; vendor preset: disabled)
  Active: failed (Result: exit-code) since Sat 2016-05-07 07:08:12 EDT; 21min ago
 Process: 29283 ExecStart=/usr/sbin/named -u named $OPTIONS (code=exited, status=1/FAILURE)
 Process: 29280 ExecStartPre=/bin/bash -c if [ ! "$DISABLE_ZONE_CHECKING" == "yes" ]; then /usr/sbin/named-checkconf -z /etc/named.conf; else echo "Checking of zone files is disabled"; fi (code=exited, status=0/SUCCESS)
Main PID: 1228 (code=exited, status=0/SUCCESS)

May 07 07:08:12 darksys.net named[29285]: command channel listening on 127.0.0.1#953
May 07 07:08:12 darksys.net named[29285]: command channel listening on ::1#953
May 07 07:08:12 darksys.net named[29285]: isc_stdio_open 'data/named.run' failed: permission denied
May 07 07:08:12 darksys.net named[29285]: configuring logging: permission denied
May 07 07:08:12 darksys.net named[29285]: loading configuration: permission denied
May 07 07:08:12 darksys.net named[29285]: exiting (due to fatal error)
May 07 07:08:12 darksys.net systemd[1]: named.service: control process exited, code=exited status=1
May 07 07:08:12 darksys.net systemd[1]: Failed to start Berkeley Internet Name Domain (DNS).
May 07 07:08:12 darksys.net systemd[1]: Unit named.service entered failed state.
May 07 07:08:12 darksys.net systemd[1]: named.service failed.

權限有問題嗎?

還有 SELinux 狀態

$ sestatus
SELinux status:                 disabled

我在chroot下創建了一個目錄

cd /var/named
mkdir chroot/var/named/data
chown named:named  chroot/var/named/data

在那之後

sudo systemctl start named.service

我檢查了它

systemctl status named.service

一切都在執行。

引用自:https://serverfault.com/questions/775399