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

bind zone file error -- unexpected end of line / input

· 52CE 我爱测

I'm sure I'm doing a stupid here ... but I've stared at it too many hours. Can someone see what's wrong with this zone file for bind9 on a Fedora-family server? (actually its the AWS distro, but that appears to be Fedora-based) T…

问题原文

原帖链接 · Daniel Wilson · CC BY-SA 3.0

I'm sure I'm doing a stupid here ... but I've stared at it too many hours. Can someone see what's wrong with this zone file for bind9 on a Fedora-family server? (actually its the AWS distro, but that appears to be Fedora-based)

The error messages are:

dns_master_load: /etc/named/zones/MyDomain.com:2: unexpected end of line
dns_master_load: /etc/named/zones/MyDomain.com:1: unexpected end of input
/etc/named/zones/MyDomain.com:10: using RFC1035 TTL semantics
zone MyDomain.com/IN: loading from master file /etc/named/zones/MyDomain.com failed: unexpected end of input
zone MyDomain.com/IN: not loaded due to errors.
_default/MyDomain.com/IN: unexpected end of input

And the zone file is:

@ttl 38400
MyDomain.com.        IN      SOA     MyDomain.com. daniel\.wilson.MyDomain.com. (
                              3         ; Serial
             604800     ; Refresh
              86400     ; Retry
            2419200     ; Expire
             604800    ; Negative Cache TTL
                38400 )
; NS
MyDomain.com.        IN      NS      oh.MyDomain.com.
MyDomain.com.        IN      NS      or.MyDomain.com.
; A
oh.MyDomain.com.     IN      A       13.58.189.20
or.MyDomain.com.     IN      A       54.190.193.149
MyDomain.com.        IN      A       13.58.189.20
; CNAME
www             cname MyDomain.com.
ftp             cname MyDomain.com.
wayne           cname MyDomain.com.
ybdev1          cname MyDomain.com.
; MX
MyDomain.com.        IN      MX      1 ASPMX.L.GOOGLE.COM.
MyDomain.com.        IN      MX      5 ALT1.ASPMX.L.GOOGLE.COM.
MyDomain.com.        IN      MX      5 ALT2.ASPMX.L.GOOGLE.COM.
MyDomain.com.        IN      MX      10 ASPMX2.GOOGLEMAIL.COM.
MyDomain.com.        IN      MX      10 ASPMX3.GOOGLEMAIL.COM.

Thanks!

已采纳解答

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

On line 1, you've typed "@ttl 38400". Instead of using the '@' character, you should use the '$' character. The line should read, "$ttl 38400".

The '@' character is a reference to the domain. For example, it would be valid to type:

@        IN      NS      oh.MyDomain.com.

instead of

MyDomain.com.        IN      NS      oh.MyDomain.com.

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

资料来源与适用范围

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

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

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