安装时我遇到以下错误,也提到了下面的区域。
[root@rohan named]# named-checkzone redhat.local /var/named/redhat.local.for
zone redhat.local/IN: rohan.redhat.local.redhat.local/MX 'rohan.redhat.local' has no address records (A or AAAA)-----{Forward zone Error}
zone redhat.local/IN: loaded serial 2010031403
OK
[root@rohan named]# named-checkzone redhat.local /var/named/redhat.local.rev
zone redhat.local/IN: NS 'rohan.redhat.local.redhat.local' has no address records (A or AAAA)--------------------------------------------------------------{Reverse Zone Error}
zone redhat.local/IN: not loaded due to errors.
You have new mail in /var/spool/mail/root
vim /var/named/redhat.local.for---------------------[Forward Zone]
$ORIGIN redhat.local.
$TTL 86400
@ SOA rohan.redhat.local. root.redhat.local. (
2010031403 ; serial
3600 ; refresh
1800 ; retry
604800 ; expire
86400 ) ; minimum
@ NS rohan.redhat.local
ns A 172.15.220.199
rohan.redhat.local MX 10 rohan.redhat.local.
rohan.redhat.local A 172.15.220.199
mail CNAME rohan.redhat.local.
~
vim /var/named/redhat.local.rev--------------------------[Reverse Zone]
$ORIGIN redhat.local.
$TTL 86400
@ IN SOA rohan.redhat.local. root.redhat.local. (
2010031403 ; serial
3600 ; refresh
1800 ; retry
604800 ; expire
86400 ) ; minimum
; name servers
@ IN NS rohan.redhat.local
199 IN PTR redhat.local.
@ IN A 172.15.220.199
199 IN PTR rohan.redhat.local.
[root@rohan named]# systemctl status named
● 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 Tue 2017-11-14 22:48:19 IST; 6s ago
Process: 4430 ExecStop=/bin/sh -c /usr/sbin/rndc stop > /dev/null 2>&1 || /bin/kill -TERM $MAINPID (code=exited, status=0/SUCCESS)
Process: 2412 ExecStart=/usr/sbin/named -u named -c ${NAMEDCONF} $OPTIONS (code=exited, status=0/SUCCESS)
Process: 7930 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 (code=exited, status=1/FAILURE)
Main PID: 2414 (code=exited, status=0/SUCCESS)
Nov 14 22:48:19 rohan.redhat.local bash[7930]: _default/dns.220.15.172.in-addr.arpa/IN: bad zone
Nov 14 22:48:19 rohan.redhat.local bash[7930]: zone localhost.localdomain/IN: loaded serial 0
Nov 14 22:48:19 rohan.redhat.local bash[7930]: zone localhost/IN: loaded serial 0
Nov 14 22:48:19 rohan.redhat.local bash[7930]: 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
Nov 14 22:48:19 rohan.redhat.local bash[7930]: zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0
Nov 14 22:48:19 rohan.redhat.local bash[7930]: zone 0.in-addr.arpa/IN: loaded serial 0
Nov 14 22:48:19 rohan.redhat.local systemd[1]: named.service: control process exited, code=exited status=1
Nov 14 22:48:19 rohan.redhat.local systemd[1]: Failed to start Berkeley Internet Name Domain (DNS).
Nov 14 22:48:19 rohan.redhat.local systemd[1]: Unit named.service entered failed state.
Nov 14 22:48:19 rohan.redhat.local systemd[1]: named.service failed.
答案1
这个错误信息很清楚的表明了问题所在:
zone redhat.local/IN: NS 'rohan.redhat.local.redhat.local' has no address records (A or AAAA)
您忘记了行末的一个点,因此请这样写:
@ IN NS rohan.redhat.local.