服务器管理员问题:dns 转发区域问题

服务器管理员问题:dns 转发区域问题

这是我的正向区域文件:

[root@m6 named]# cat ourlinuxtutorials.com.db
$TTL 1D 86400
@ IN SOA m6.ourlinuxtutorials.com. root.m6.ourlinuxtutorials.com. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
IN NS m6.ourlinuxtutorials.com.
IN A 127.0.0.1
m6 IN A 192.34.61.117

错误是否由于以下原因造成:

<<< @ IN SOA m6.ourlinuxtutorials.com. root.m6.ourlinuxtutorials.com. (

m6.ourlinuxtutorials.com是主机名。

因此行:

IN NS m6.ourlinuxtutorials.com.

应该m6.ourlinuxtutorials.com是名称服务器,但事实并非如此。那一定是错误了?

重新启动命名时也会出现错误:

[root@m6 named]# service named restart
Stopping named: [ OK ]
Starting named:
Error in named configuration:
dns_master_load: ourlinuxtutorials.com.db:1: extra input text
zone ourilinuxtutorials.com/IN: loading from master file ourlinuxtutorials.com.db failed: extra input text
zone ourilinuxtutorials.com/IN: not loaded due to errors.
_default/ourilinuxtutorials.com/IN: extra input text
zone 61.34.192.in-addr.arpa/IN: loaded serial 0
zone localhost.localdomain/IN: loaded serial 0
zone localhost/IN: loaded serial 0
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
zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0
zone 0.in-addr.arpa/IN: loaded serial 0
[FAILED]

答案1

我认为这些话:

<<< @ IN SOA m6.ourlinuxtutorials.com. root.m6.ourlinuxtutorials.com. (

应该是这样的:

IN SOA  m6.ourlinuxtutorials.com. root.ourlinuxtutorials.com. (

看看这个示例域主文件

例子

$TTL    86400 ; 24 hours could have been written as 24h or 1d
$ORIGIN example.com.
@  1D  IN    SOA ns1.example.com.   hostmaster.example.com. (
                  2002022401 ; serial
                  3H ; refresh
                  15 ; retry
                  1w ; expire
                  3h ; minimum
                 )
       IN  NS     ns1.example.com. ; in the domain
       IN  NS     ns2.smokeyjoe.com. ; external to domain
       IN  MX  10 mail.another.com. ; external mail provider
; server host definitions
ns1    IN  A      192.168.0.1  ;name server definition     
www    IN  A      192.168.0.2  ;web server definition
ftp    IN  CNAME  www.example.com.  ;ftp server definition
; non server domain hosts
bill   IN  A      192.168.0.3
fred   IN  A      192.168.0.4 

第一行也看起来像是拼写错误:

我认为它应该是$TTL 1D,而不是$TTL 1D 86400。这就是错误所抱怨的内容,第 1 行:

dns_master_load: ourlinuxtutorials.com.db:1: extra input text

相关内容