无法加载命名;因为区域文件错误

无法加载命名;因为区域文件错误

我尝试创建一个名为(我相信它也被称为“BIND”)的 DNS 服务器。

当我尝试加载服务器时,我得到:

 systemctl status named.service
* named.service - Berkeley Internet Name Domain (DNS)
   Loaded: loaded (/usr/lib/systemd/system/named.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sat 2017-02-11 18:03:56 IST; 6s ago
  Process: 20571 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=1/FAILURE)

这是/usr/sbin/named-checkconf -z /etc/named.conf

/var/named/prognoza.cu.cc.zone:1: unknown RR type 'prognoza.cu.cc.'
/var/named/prognoza.cu.cc.zone:9: no TTL specified; zone rejected
/var/named/prognoza.cu.cc.zone:11: no TTL specified; zone rejected
/var/named/prognoza.cu.cc.zone:14: no TTL specified; zone rejected
/var/named/prognoza.cu.cc.zone:15: no TTL specified; zone rejected
zone prognoza.cu.cc/IN: loading from master file /var/named/prognoza.cu.cc.zone failed: unknown class/type
zone prognoza.cu.cc/IN: not loaded due to errors.
_default/prognoza.cu.cc/IN: unknown class/type
zone localhost.localdomain/IN: loaded serial 0
zone localhost/IN: loaded serial 0
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
zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0
zone 0.in-addr.arpa/IN: loaded serial 0

/var/named/prognoza.cu.cc

OA     prognoza.cu.cc. (
        2013042201  ;Serial
        3600        ;Refresh
        1800        ;Retry
        604800      ;Expire
        3600       ;Minimum TTL
)
; Specify our two nameservers
                IN      NS              ns1.prognoza.cu.cc.
; Resolve nameserver hostnames to IP, replace with your two droplet IP addresses.
ns1             IN      A               31.220.108.9

; Define hostname -> IP pairs which you wish to resolve
@               IN      A               31.220.108.9
www             IN      A               31.220.108.9

我不明白哪里出了问题。我首先尝试创建 A DNS 记录。稍后我想添加 MX 和 PTR,但我无法成功安装 A 记录且没有任何错误。我的 VPS 在 centos 上运行。有人能帮我吗?

编辑

实施 Håkan Lindqvist 的更改后,我收到以下错误:

dns_rdata_fromtext: /var/named/prognoza.cu.cc.zone:6: near eol: unexpected end of input
/var/named/prognoza.cu.cc.zone:9: no TTL specified; zone rejected
/var/named/prognoza.cu.cc.zone:11: no TTL specified; zone rejected
/var/named/prognoza.cu.cc.zone:14: no TTL specified; zone rejected
/var/named/prognoza.cu.cc.zone:15: no TTL specified; zone rejected
zone prognoza.cu.cc/IN: loading from master file /var/named/prognoza.cu.cc.zone failed: unexpected end of input

答案1

第一条记录看起来是一条混乱的SOA记录:

OA     prognoza.cu.cc. (
        2013042201  ;Serial
        3600        ;Refresh
        1800        ;Retry
        604800      ;Expire
        3600       ;Minimum TTL
)

假设你的意思是这样的:

@ IN SOA     ns1.prognoza.cu.cc. hostmaster.prognoza.cu.cc. (
        2013042201  ;Serial
        3600        ;Refresh
        1800        ;Retry
        604800      ;Expire
        3600       ;Minimum TTL
)

相关内容