大网数据广告活动
服务器运维问答

no current owner name error when running named-checkzone on both forward and reverse

· 52CE 我爱测

I'm trying to learn dns and bind on centos 7 at digital ocean. When I run named-checkzone I get the same errors. When I change around the white space I stop that error only to replace it with a 0 SOA and no NS error. sudo named-c…

问题原文

原帖链接 · Neil Anuskiewicz · CC BY-SA 3.0

I'm trying to learn dns and bind on centos 7 at digital ocean. When I run named-checkzone I get the same errors. When I change around the white space I stop that error only to replace it with a 0 SOA and no NS error.

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

Same thing with the reverse called 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.

社区高分解答

原帖链接 · HBruijn · CC BY-SA 3.0

As Julie Pelletier already commented, remove the leading white spaces in your zone records, as they hold a special meaning in Bind zone files.

By starting a line with a white space (which is neither a hostname, the zone name or the @ shorthand for the zone origin) that line becomes a continuation of the record above it.

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

That makes the line with the SOA record a continuation of the none existent record above it (the variables don't count in that regard) and hence your failure; there is resource record above it, no owner to apply that continuation record to.

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

You can intentionally use lines starting with a white space to though:

@                    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

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-08-20)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。