LinuxSir.cn,穿越时空的Linuxsir!

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

求助! 关于dns的问题

[复制链接]
发表于 2004-3-31 23:14:47 | 显示全部楼层 |阅读模式
我配置了dns,在本机上解释本域的域名没问题,但在同一个局域网的机器就是连不上.这该怎么办呢?我在named.conf的option中加上了
           allow-query { any; };
           allow-recursion {any; };

   还有我加上了
           forward only;
           forwarders { 202.198.168.3; };
   这对不对呀?我还是不能解释其他域的名字.
   谢谢高手赐教.
发表于 2004-4-1 01:24:07 | 显示全部楼层

forward only;
forwarders { 202.198.168.3; };
位置换一下看看,或是将forward only;去掉
发表于 2004-4-1 04:00:40 | 显示全部楼层

forward only;
forwarders { 202.198.168.3; };
去掉
发表于 2004-4-1 04:51:51 | 显示全部楼层
只剩下这句forwarders { 202.198.168.3; };

看下是否可以 ?
 楼主| 发表于 2004-4-2 01:21:32 | 显示全部楼层
还是不行, 最可怕的是 加上
forward only;
forwarders { 202.198.168.3; };
这两行就根没加没什么两样,如下:

nslookup www.jlu.edu.cn 219.217.56.137
Note:  nslookup is deprecated and may be removed from future releases.
Consider using the `dig' or `host' programs instead.  Run nslookup with
the `-sil[ent]' option to prevent this message from appearing.
;; connection timed out; no servers could be reached

竟然no servers could be reached,如果我解析不了应该反回信息吧.

不过我的问题还不止这些,我还不能解析其他域名呢.我是自己随便建的域,那我能不能通过根名字服务器解析其他域名呢?不过用forwarders总行吧?

现在先能解析其它域名就好了,请大家指点一二,谢谢啦.
发表于 2004-4-2 01:25:08 | 显示全部楼层
你将你所有的dns配置文件贴上来,这样说哪够 ?

之前我是以为你只能解析自己不能解析别人,,
 楼主| 发表于 2004-4-2 10:39:29 | 显示全部楼层
好,现在就来啦:

// generated by named-bootconf.pl

options {
        directory "/var/named";
        /*
         * 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;
           listen-on { 219.217.56.137; };
           forwarders { 202.198.168.3; };  //把 forward only; 去了.
           allow-query { any; };
           allow-recursion {any; };

};

//
// a caching only nameserver config
//
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 "bao.jlu.edu.cn" IN {
        type master;
        file "bao.zone";
        allow-update { none; };
};

zone "56.217.219.in-addr.arpa" IN {
        type master;
        file "bao.rr.zone";
        allow-update { none; };
};
         
include "/etc/rndc.key";


现在是能解析bao.jlu.edu.cn中的域名,其他的不能.

这是bao.zone文件:
$ORIGIN bao.jlu.edu.cn.
$TTL 86400
@     IN     SOA   billy.bao.jlu.edu.cn.    root.mail.bao.jlu.edu.cn. (
                      2004032817      ; serial (d. adams)
                                        3H                ; refresh
                                        15M                ; retry
                                        1W                ; expiry
                                        1D )                ; minimum


      IN     NS     billy.bao.jlu.edu.cn.

      IN     MX     10     mail.bao.jlu.edu.cn.

             IN     A      219.217.56.137

yyz           IN     A      219.217.56.136
billy          IN     A      219.217.56.137
ftp          IN     CNAME   billy
mail         IN     CNAME   billy
www        IN     CNAME   billy

这是bao.rr.zone文件:
$ORIGIN 56.217.219.in-addr.arpa.
$TTL    86400
@       IN      SOA     billy.bao.jlu.edu.cn. root.billy.bao.jlu.edu.cn.  (
                                     2004032817         ; serial (d. adams)
                                        3H                ; refresh
                                        15M                ; retry
                                        1W                ; expiry
                                        1D )                ; minimum
       IN      NS      billy.bao.jlu.edu.cn.
137      IN      PTR     billy.bao.jlu.edu.cn.
136     IN      PTR     yyz.bao.jlu.edu.cn.

这么贴信息够不够?不知道有什么毛病.为什么不能解析其他的域名呢?
谢谢版主,谢谢大家.
发表于 2004-4-2 10:44:43 | 显示全部楼层
看不出有什么问题,你的/etc/resolv.conf肯定是设自己ip

或许这样,你可以将别人的配置文件先拷过来修改用先,有些错误你就会发现出来,之前我也是找了很久都找不出自己的错误,我就用此办法
 楼主| 发表于 2004-4-2 14:59:49 | 显示全部楼层
关于一个局域网不能访问的问题解决了,原因是 iptables 的设置不对,加上

iptables -A INPUT -p udp -d 219.217.56.137 --dport domain  -i eth0 -j ACCEPT

iptables -A INPUT -p tcp  -d 219.217.56.137 --dport domain  -i eth0 -j ACCEPT

就好了,可是还是不能解析其他的域名,是不是自己的域名要注册才行阿?真痛苦!!
发表于 2004-4-2 15:23:22 | 显示全部楼层
你做为内部的不需要注册,,外部的不注册也可以,但别人解析不到你

上面你的iptables里的domain代表什么,应该为53才对,
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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