在正向和反向运行 named-checkzone 时均无当前所有者名称错误

在正向和反向运行 named-checkzone 时均无当前所有者名称错误

我正在 Digital Ocean 上尝试学习 CentOS 7 上的 DNS 和绑定。运行时named-checkzone我遇到了同样的错误。当我更改空白处时,我停止了该错误,只是将其替换为 0 SOA 且没有 NS 错误。

sudo named-checkzone example.com /etc/named/zones/example.com.zone
/etc/named/zones/example.com.zone:1: no current owner name
/etc/named/zones/example.com.zone:2: no current owner name
/etc/named/zones/example.com.zone:3: no current owner name
/etc/named/zones/example.com.zone:16: no current owner name
/etc/named/zones/example.com.zone:17: no current owner name
/etc/named/zones/example.com.zone:18: no current owner name
/etc/named/zones/example.com.zone:19: no current owner name
/etc/named/zones/example.com.zone:24: no current owner name
/etc/named/zones/example.com.zone:25: no current owner name
/etc/named/zones/example.com.zone:26: no current owner name
/etc/named/zones/example.com.zone:27: no current owner name
/etc/named/zones/example.com.zone:28: no current owner name
/etc/named/zones/example.com.zone:29: no current owner name  

$ORIGIN example.com.
$TTL 14400
@    IN    SOA    ns1.example.com.    hostmaster.example.com. (
2014071301 ; serial.  date.    today + increment
3600       ; refresh. seconds. frequency slave refreshes from master.
600        ; retry.   seconds. frequency slave retries master after failure.
604800     ; expire.  seconds. slave stops responding as authoritative.
86400      ; ttl.     seconds. Maximum caching time by resolver.
)

;------------------------------------------------------------------------------
; Special Records
;
; Note: SPF Records are limited to 10 DNS lookups recursively.
;
IN NS    ns1.example.com.
IN NS    ns2.example.com.
IN MX    10   mail.example.com.
IN TXT  "v=spf1 -ALL"

;------------------------------------------------------------------------------
; Main Records
;
@           IN A    192.0.2.1
*           IN A    192.0.2.1
ns1         IN A    192.0.2.2
ns2         IN A    192.0.2.3
mail        IN A    192.0.2.1
www         IN A   192.0.2.1

反向操作与 db.192.0 相同

$ORIGIN  2.0.192.in-addr.arpa.
$TTL 86400

@      IN      SOA     ns1.example.com.        hostmaster.example.com. (
3 ; serial
21600      ; refresh after 6 hours
3600       ; retry after 1 hour
604800     ; expire after 1 week
86400 )    ; minimum TTL of 1 day

@  IN  NS     ns1.example.com.
2             IN      PTR     ns1.example.com.
3             IN      PTR     ns2.example.com.

答案1

正如 Julie Pelletier 已经评论的那样,删除区域记录中的前导空格,因为它们在绑定区域文件中具有特殊含义。

通过以空格(既不是主机名,也不是区域名称或区域原点的 @ 简写)开始一行,该行将成为其上方记录的延续。

$ORIGIN neilanuskiewicz.com.
$TTL 14400
 @    IN    SOA    ns1.neilanuskiewicz.com.   ...

这使得 SOA 记录的行成为其上方不存在的记录的延续(变量在这方面不算数),因此导致失败;其上方有资源记录,没有所有者可以将该延续记录应用于。

$ORIGIN neilanuskiewicz.com.
$TTL 14400
@    IN    SOA    ns1.neilanuskiewicz.com.   ...

但是,您可以有意使用以空格开头的行来:

@                    IN  A     192.0.2.1       ; IPv4 address for the bare domain using the @ short hand
neilanuskiewicz.com. IN  AAAA  2001:db8:10::1  ; IPv6 address for the bare domain
www                  IN  A     192.0.2.1            
                     IN  AAAA  2001:db8:10::1  ; IPv6 address for www using DNS shorthand by starting this line with a space

相关内容