Bind

服務命名失敗(壞區)

  • August 9, 2016

我正在嘗試為域名 innovisage.local 創建一個新的主區域,但不斷出現錯誤。

我正在使用 WebMin 來配置新的主區域,所以它在語法上應該是正確的。我還手動檢查了區域文件和配置文件,它們對我來說似乎都是正確的。

這是錯誤日誌:

-- Unit named.service has begun starting up.
Aug 09 22:07:58 centos7-test.innovisage.local bash[5496]: zone            localhost.localdomain/IN: loaded serial 0
Aug 09 22:07:58 centos7-test.innovisage.local bash[5496]: zone localhost/IN: loaded serial 0
Aug 09 22:07:58 centos7-test.innovisage.local bash[5496]: 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
Aug 09 22:07:58 centos7-test.innovisage.local bash[5496]: zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0
Aug 09 22:07:58 centos7-test.innovisage.local bash[5496]: zone 0.in-addr.arpa/IN: loaded serial 0
Aug 09 22:07:58 centos7-test.innovisage.local bash[5496]: zone innovisage.local/IN: NS 'centos7-test.innovisage.local' has no address records (A or AAAA)
Aug 09 22:07:58 centos7-test.innovisage.local bash[5496]: zone innovisage.local/IN: not loaded due to errors.
Aug 09 22:07:58 centos7-test.innovisage.local bash[5496]: _default/innovisage.local/IN: bad zone
Aug 09 22:07:58 centos7-test.innovisage.local systemd[1]: named.service: control process exited, code=exited status=1
Aug 09 22:07:58 centos7-test.innovisage.local systemd[1]: Failed to start Berkeley Internet Name Domain (DNS).
-- Subject: Unit named.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit named.service has failed.
--
-- The result is failed.
Aug 09 22:07:58 centos7-test.innovisage.local systemd[1]: Unit named.service entered failed state.
Aug 09 22:07:58 centos7-test.innovisage.local systemd[1]: named.service failed.

這是配置文件。

options {
   listen-on port 53 {
           192.168.1.7;
           };

   directory       "/var/named";
   dump-file       "/var/named/data/cache_dump.db";
   statistics-file "/var/named/data/named_stats.txt";
   memstatistics-file "/var/named/data/named_mem_stats.txt";

   recursion yes;
   dnssec-enable yes;
   dnssec-validation yes;

   /* Path to ISC DLV key */
   bindkeys-file "/etc/named.iscdlv.key";

   managed-keys-directory "/var/named/dynamic";

   pid-file "/run/named/named.pid";
   session-keyfile "/run/named/session.key";
   forwarders {
           203.12.160.35;
           203.12.160.36;
           8.8.8.8;
           };
};

logging {
   channel default_debug {
           file "data/named.run";
           severity dynamic;
   };
};

zone "." IN {
   type hint;
   file "named.ca";
};

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

zone "innovisage.local" {
   type master;
   file "/var/named/innovisage.local.hosts";
   };

這是我的區域文件:

$ttl 38400
innovisage.local.       IN      SOA     centos7-test.innovisage.local. sophal.lee.live.com (
                       1470744461
                       10800
                       3600
                       604800
                       38400 )
innovisage.local.       IN      NS      centos7-test.innovisage.local.

您在區域文件中確實擁有的記錄看起來是正確的,但是您沒有足夠的記錄,您的區域不完整。您發布的錯誤消息非常清楚:

NS ‘centos7-test.innovisage.local’ 沒有地址記錄(A 或 AAAA)

解決方案也很簡單,您需要添加該 A 或 AAAA 記錄:

centos7-test.innovisage.local. IN A 198.51.100.1 

或 DNS 速記中的等價物

centos7-test IN A 198.51.100.1

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