LinuxSir.cn,穿越时空的Linuxsir!

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

debian etch,配置DNS,本机成功,但同一个局域网中的其他主机(windows xp)不能正常使用,恳

[复制链接]
发表于 2009-6-14 21:57:35 | 显示全部楼层 |阅读模式
bind9 安装的是,下面是我的配置文件,目录:/etc/bind
db.0    db.255    db.lw       named.conf.local        rndc.key
db.127  db.empty  db.root     named.conf.options      zones.rfc1918
db.192  db.local  named.conf  named.conf.options.bak




named.conf:内容:
// This is the primary configuration file for the BIND DNS server named.
//
// Please read /usr/share/doc/bind9/README.Debian.gz for information on the
// structure of BIND configuration files in Debian, *BEFORE* you customize
// this configuration file.
//
// If you are just adding zones, please do that in /etc/bind/named.conf.local

include "/etc/bind/named.conf.options";

// prime the server with knowledge of the root servers
zone "." {
        type hint;
        file "/etc/bind/db.root";
};

// be authoritative for the localhost forward and reverse zones, and for
// broadcast zones as per RFC 1912

zone "localhost" {
        type master;
        file "/etc/bind/db.local";
};

zone "127.in-addr.arpa" {
        type master;
        file "/etc/bind/db.127";
};

zone "0.in-addr.arpa" {
        type master;
        file "/etc/bind/db.0";
};

zone "255.in-addr.arpa" {
        type master;
        file "/etc/bind/db.255";
};

// zone "com" { type delegation-only; };
// zone "net" { type delegation-only; };

// From the release notes:
//  Because many of our users are uncomfortable receiving undelegated answers
//  from root or top level domains, other than a few for whom that behaviour
//  has been trusted and expected for quite some length of time, we have now
//  introduced the "root-delegations-only" feature which applies delegation-only
//  logic to all top level domains, and to the root domain.  An exception list
//  should be specified, including "MUSEUM" and "DE", and any other top level
//  domains from whom undelegated responses are expected and trusted.
// root-delegation-only exclude { "DE"; "MUSEUM"; };

include "/etc/bind/named.conf.local";




named.conf.local::内容是:
acl test192 {
192.168.0/24;
};

zone "lw" {
        type master;
        file "/etc/bind/db.lw";
        allow-query{test192;};
};


zone "192.in-addr.arpa" {
        type master;
        file "/etc/bind/db.192";
};



name.conf.option::内容是:
options {
        directory "/var/cache/bind";
        // 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 and later use an unprivileged
        // port by default.

        // query-source address * port 53;

        // If your ISP provided one or more IP addresses for stable
        // nameservers, you probably want to use them as forwarders.  
        // Uncomment the following block, and insert the addresses replacing
        // the all-0's placeholder.

        // forwarders {
        //         0.0.0.0;
        // };
        listen-on port 53{
127.0.0.1;
192.168.0.3;
};
        auth-nxdomain no;    # conform to RFC1035
        listen-on-v6 { any; };
};

        // If there is a firewall between you and nameservers you want




db.lw::内容是:
;
; BIND data file for local loopback interface
;
$TTL        604800
@        IN        SOA        localhost. root.localhost. (
                              1                ; Serial
                         604800                ; Refresh
                          86400                ; Retry
                        2419200                ; Expire
                         604800 )        ; Negative Cache TTL
;
@        IN        NS        localhost.
@        IN        A        192.168.0.3
gxg.lw. IN      A       192.168.0.5




db.192:内容是:
;
; BIND reverse data file for local loopback interface
;
$TTL        604800
@        IN        SOA        localhost. root.localhost. (
                              1                ; Serial
                         604800                ; Refresh
                          86400                ; Retry
                        2419200                ; Expire
                         604800 )        ; Negative Cache TTL
;
@        IN        NS        localhost.
3.0.168        IN        PTR        lw.
5.0.168 IN      PTR     gxg.lw.


我自己可以正常访问:http://lw:8080和http://192.168.0.3:8080
但其他主机只能访问:http://192.168.0.3:8080
并且:我可以访问:http://gxg.lw:8080和http://192.168.0.5:8080
但其他主机只能访问:http://192.168.0.5:8080
其它主机的DNS,我已经设定为:192.168.0.3,且为首先DNS,并且测试可以telent到53端口。

请高手指点一下思路?我该往那个地方考虑?
第一次发帖,发帖方式不足之处,恳请指出!
 楼主| 发表于 2009-6-15 17:18:20 | 显示全部楼层

我成功了,

其他的主机可以使用了,我修改了db.lw里面的内容,把里面的localhost换成了lw,还有一点就是,刚开始,要等一会才行,他要有一个过程,
我是这样作的,把这台主机上的公共ip,网关,DNS,等都先删除,只留下私有IP和对应的DNS,成功,后,添加公共ip,网关,DNS,等,这个时候,我配的私有网络的解析服务成功,公共网也能上,

但在另一台主机上还是不行,难道是要想正常使用一定要安照上面的说的步骤来做吗,这是为什么呢?
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

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