这是我的 DNS 转发文件,当我想将其作为服务运行时,它给出了错误。我认为这是一个语法错误,但不知道如何纠正它?
$TTL 86400
@ IN SOA ns1.sudia.com. root.sudia.com. (
3 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)
@ IN SOA ns2.sudia.com. root.sudia.com. (
3 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)
;Name Server Information
@ IN NS ns1.sudia.com.
@ IN NS ns2.sudia.com.
;IP address of Name Server
ns1 IN A 136.243.197.164
ns2 IN A 136.243.197.164
;A - Record HostName To Ip Address
sudia.com. IN A 136.243.197.164
www IN A 136.243.197.164
;CNAME record
ftp IN CNAME www.sudia.com.
这是错误:
(base) [root@wdrserver named]# 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 Mon 2020-06-22 23:39:21 +0430; 13s ago
Process: 3135 ExecStop=/bin/sh -c /usr/sbin/rndc stop > /dev/null 2>&1 || /bin/kill -TERM $MAINPID (code=exited, status=0/SUCCESS)
Process: 3110 ExecStart=/usr/sbin/named -u named -c ${NAMEDCONF} $OPTIONS (code=exited, status=0/SUCCESS)
Process: 3233 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 (co>
Main PID: 3111 (code=exited, status=0/SUCCESS)
Jun 22 23:39:21 wdrserver bash[3233]: zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0
Jun 22 23:39:21 wdrserver bash[3233]: zone 0.in-addr.arpa/IN: loaded serial 0
Jun 22 23:39:21 wdrserver bash[3233]: dns_master_load: fwd.sudia.com.db:28: sudia.com: multiple RRs of singleton type
Jun 22 23:39:21 wdrserver bash[3233]: zone sudia.com/IN: loading from master file fwd.sudia.com.db failed: multiple RRs of singleton type
Jun 22 23:39:21 wdrserver bash[3233]: zone sudia.com/IN: not loaded due to errors.
Jun 22 23:39:21 wdrserver bash[3233]: _default/sudia.com/IN: multiple RRs of singleton type
Jun 22 23:39:21 wdrserver bash[3233]: zone 197.243.136.in-addr.arpa/IN: loaded serial 3
Jun 22 23:39:21 wdrserver systemd[1]: named.service: Control process exited, code=exited status=1
Jun 22 23:39:21 wdrserver systemd[1]: named.service: Failed with result 'exit-code'.
Jun 22 23:39:21 wdrserver systemd[1]: Failed to start Berkeley Internet Name Domain (DNS).
答案1
关键错误是multiple RRs of singleton type
。简而言之,您不能为该区域拥有多条 SOA 记录。您需要删除:
@ IN SOA ns2.sudia.com. root.sudia.com. (
3 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)
因此,示例区域的更新版本将是:
例如 var/named/fwd.sudia.com.db
$TTL 86400
@ IN SOA ns1.sudia.com. root.sudia.com. (
5 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)
;Name Server Information
@ IN NS ns1.sudia.com.
@ IN NS ns2.sudia.com.
;IP address of Name Server
ns1 IN A 136.243.197.164
ns2 IN A 136.243.197.164
;A - Record HostName To Ip Address
sudia.com. IN A 136.243.197.164
www IN A 136.243.197.164
;CNAME record
ftp IN CNAME www.sudia.com.