LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 905|回复: 6

[金典问题]配置的DNS服务器出错了,

[复制链接]
发表于 2004-4-7 09:50:20 | 显示全部楼层 |阅读模式
我是用在机房的,局域网网段192.168.0.0/24,外部网卡地址是10.56.21.177
DNS是10.56.20.12 内网DNS服务器地址是192.168.0.2
局域网中我的域名是langzi.com,主机名redhat
我的 配置是这样的,我把所有的文件和错误信息写出来
1.resolv.conf
----------------------------------------------------------------------------
nameserver 192.168.0.2
domain langzi.com
search langzi.com
-----------------------------------------------------------------------------
2.hosts
-----------------------------------------------------------------------------
192.168.0.2 redhat.langzi.com redhat
------------------------------------------------------------------------------
3.host.conf
-----------------------------------------------------------------------------
order bind hosts
------------------------------------------------------------------------------
4.name.conf
-----------------------------------------------------------------------------
options {
directory "/var/named";
forwarders{10.56.20.12;};
};


zone "." IN {
type hint;
file "named.ca";
};

zone "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
};

zone "0.0.127.in-addr.arpa" IN {
type master;
file "0.0.127.zone";
allow-update { none; };
};
zone "lagnzi.com" IN {
type master;
file "langzi.com.zone";
allow-update { none;};
};
zone "0.168.192.in-addr.arpa" IN{
type master;
file "0.168.192.zone";
allow-update { none;};
};

-------------------------------------------------------------------------------
5.0.0.127.zone
--------------------------------------------------------------------------------

$TTL 86400
@ IN SOA localhost. root.lcoalhost. (
2002120601 ; serial
28800 ; refresh
7200 ; retry
604800 ; expire
86400 ; ttk
)


  IN NS localhost.

1 IN PTR localhost.
------------------------------------------------------------------------------------
6.localhost.zone
------------------------------------------------------------------------------------
$TTL 86400
$ORIGIN localhost.
@ IN SOA localhost. root.localhost. (
2002120601 ; serial
28800 ; refresh
7200 ; retry
604800 ; expire
86400 ; ttl
)


           IN NS localhost.


localhost. IN A 127.0.0.1
-------------------------------------------------------------------------------
7.0.168.192.zone
--------------------------------------------------------------------------------

$TTL 86400
@ IN SOA redhat.langzi.com. root.redhat.langzi.com. (
2002120601
28800
7200
604800
86400 )



  IN NS redhat.langzi.com.
2 IN PTR redhat.langzi.com.
---------------------------------------------------------------------------------
8.langzi.com.zone
--------------------------------------------------------------------------------

  $TTL 86400
  @ IN SOA redhat.langzi.com. langzi.com. (
    2002103000 ; Serial
    28800 ; Refresh
    14400 ; Retry
    3600000 ; Expire
    86400 ) ; Minimum
         IN NS redhat.langzi.com.
  
  redhat IN A 192.168.0.2
---------------------------------------------------------------------------------

message 信息
------------------------------------------------------------------------------------
Apr 2 12:01:48 redhat named[2738]: starting BIND 9.2.1 -u named
Apr 2 12:01:48 redhat named[2738]: using 1 CPU
Apr 2 12:01:48 redhat named[2738]: loading configuration from '/etc/named.conf'
Apr 2 12:01:48 redhat 4月 2 12:01:48 named: named startup succeeded
Apr 2 12:01:48 redhat named[2738]: no IPv6 interfaces found
Apr 2 12:01:48 redhat named[2738]: listening on IPv4 interface lo, 127.0.0.1#53
Apr 2 12:01:48 redhat named[2738]: listening on IPv4 interface eth0, 192.168.0.2#53
Apr 2 12:01:48 redhat named[2738]: listening on IPv4 interface eth1, 10.56.21.178#53
Apr 2 12:01:48 redhat named[2738]: command channel listening on 127.0.0.1#953
Apr 2 12:01:49 redhat named[2738]: zone 0.0.127.in-addr.arpa/IN: loaded serial 2002120601
Apr 2 12:01:49 redhat named[2738]: dns_master_load: 192.168.0.2.zone:3: unexpected end of line
Apr 2 12:01:49 redhat named[2738]: dns_master_load: 192.168.0.2.zone:2: unexpected end of input
Apr 2 12:01:49 redhat named[2738]: zone 0.168.192.in-addr.arpa/IN: loading master file 192.168.0.2.zone: unexpected end of input
Apr 2 12:01:49 redhat named[2738]: dns_master_load: langzi.com.zone:3: unexpected end of line
Apr 2 12:01:49 redhat named[2738]: dns_master_load: langzi.com.zone:2: unexpected end of input
Apr 2 12:01:49 redhat named[2738]: zone lagnzi.com/IN: loading master file langzi.com.zone: unexpected end of input
Apr 2 12:01:49 redhat named[2738]: zone localhost/IN: loaded serial 2002120601
Apr 2 12:01:49 redhat named[2738]: running
------------------------------------------------------------------------------
能进行dns转发
发表于 2004-4-7 10:51:24 | 显示全部楼层
兄弟你发了那么多贴,都还没得到解决 ?

这样吧,你先找个正确的dns配置文件覆盖一下,再修改成你的域名,

有些错误可能你一时看不出来
发表于 2004-4-7 10:54:06 | 显示全部楼层
你的是redhat系统?
发表于 2004-4-7 11:26:59 | 显示全部楼层
我的给你参考一下!


/etc/named.conf
// generated by named-bootconf.pl

options {
        directory "/var/named";
        forwarders {                202.116.128.1;         192.168.100.1;        };

                notify yes;
        /*
         * If there is a firewall between you and nameservers you want
         * to talk to, you might need to uncomment the query-source
         * directive below.  Previous versions of BIND always asked
         * questions using port 53, but BIND 8.1 uses an unprivileged
         * port by default.
         */
        // query-source address * port 53;

};

logging {
channel LAMER_log {
file "/var/log/dns/dns-lamer.log" versions 3  size 10m;
severity info;
print-severity yes;  print-time yes;
};

channel SEC_log {
file "/var/log/dns/dns-sec.log" versions 3   size 10m;
severity info;
print-severity yes;  print-time yes;
};

channel STAT_log {
file "/var/log/dns/dns-stat.log" versions 3  size  10m;
severity info;
print-severity yes;  print-time yes;
};

category lame-servers { LAMER_log; };
category security { SEC_log; };
};

/* category cname { null; };
   category statistics { STAT_log; };*/


controls {
        inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};
zone "." IN {
        type hint;
        file "named.ca";
};

zone "localhost" IN {
        type master;
        file "localhost.zone";
        allow-update { none; };
};

zone "0.0.127.in-addr.arpa" IN {
        type master;
        file "named.local";
        allow-update { none; };
};

zone "snoopy.gov" {
        type master;
        file "snoopy.gov";
        allow-query { any; };
};


zone "b011306.com" {
        type master;
        file "b011306.com";
        allow-query { any; };
        allow-transfer {
                                                192.168.206.0/24;
                                };
};

zone "206.168.192.in-addr.arpa" IN {
        type master;
        file "snoopy.ptr";
};


include "/etc/rndc.key";

/var/named/snoopy.gov
$ttl 16097
@                         IN                 SOA                 snoopy.gov.                 root.localhost. (
                                                                                                                                                                        2003088809;
                                                                                                                                                                        28800;
                                                                                                                                                                        14400;
                                                                                                                                                                        3600000;
                                                                                                                                                                        16097);
                    IN                 NS                         ns.snoopy.gov.   
              IN          A                                192.168.206.8
                                IN                MX        10        ns.snoopy.gov.
ns                  IN                 A                         192.168.206.8
www                 IN                 CNAME         ns
mail                IN                CNAME                ns


/var/named/snoopy.ptr
$ttl 16097
@                                         IN                                 SOA                                                 ns.snoopy.gov.                                 root.localhost. (
                                                                                                                                                                                                                                                        2003088808;
                                                                                                                                                                                                                                                        28800;
                                                                                                                                                                                                                                                        14400;
                                                                                                                                                                                                                                                        3600000;
                                                                                                                                                                                                                                                        16097);
                                           IN                                 NS                                                 ns.snoopy.gov.
8                                                IN                                PTR                                                ns.snoopy.gov.


/var/named/b011306.com
$ttl 16097
@                                        IN                         SOA                         ns.b001306.com.                         root.localhost. (
                                                                                                                                                                                                                2003088807;
                                                                                                                                                                                                                28800;
                                                                                                                                                                                                                14400;
                                                                                                                                                                                                                3600000;
                                                                                                                                                                                                                16097);
                            IN                         NS                                 ns.b011306.com.
                                        IN                        A                                        192.168.206.8
                                        MX                         10                                mail.b011306.com.
ns                          IN                         A                                 192.168.206.8
mail                        IN                        A                                        192.168.206.8
www                         IN                         CNAME                 ns.b011306.com.
 楼主| 发表于 2004-4-7 13:38:38 | 显示全部楼层
谢谢,我先试试看
 楼主| 发表于 2004-4-7 14:06:48 | 显示全部楼层
还是不行,我是默认安装的redhat 9 是不是系统问题
发表于 2004-4-8 08:18:01 | 显示全部楼层
内核为 2.4.20-8 的RH9 系统对于 bind的支持有问题.
官方的建议是升级内核至 2.4.20-9 以上.

< 详情 >
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表