LinuxSir.cn,穿越时空的Linuxsir!

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

新手架dns服务器,请大家来批评指正.谢谢(已解决)

[复制链接]
发表于 2007-8-24 16:13:23 | 显示全部楼层 |阅读模式
初学linux,想在内网架设一个dns,并在此基础上架设一个mail服务器.我来说说我的方法,欢迎大家指正.

首先,我的机器名称是 mail.fbe.net 简称是 mail ,linux 用的是 RH AS 3.0 .bind 版本是 bind-9.2.4-1_EL3

内网有个dns,地址是 192.168.253.3
我们这里每台机器的IP和MAC是绑定的,我的ip是 192.168.68.82

bind在安装linux的时候就已经安装了.几个相关文件配置如下:

/etc/hosts

#do not remove the following line, or various programs
# that require network functionality will fail.

127.0.0.1          localhost      local
192.168.68.82      mail.fbe.net    mail




/etc/host.conf

#order hosts,bind
order bind,hosts




/etc/resolve.conf

#MADE-BY-RP-PPPOE
search mail.fbe.net
nameserver 192.168.68.82
nameserver 192.168.253.3


/etc/named.conf

我增加了这样2条  保存的文件分别是 named.fbe.net (正向解析),   named.ip(反向解析)

zone "fbe.net" in {
      type master;
      file "named.fbe.net";
};

zone "68.168.192.in-addr.arpa" in {
      type master;
      file "named.ip";
};




/var/named/named.fbe.net

$TTL 86400
@ IN  SOA  mail.fbe.net.  root.mail.fbe.net. (
                   20030816
                   28800
                   7200
                   3600000
                   84600  )
            IN        NS         mail.fbe.net.
            IN        MX   10    mail.fbe.net.


localhost                IN         A         127.0.0.1
mail                    IN         A         192.168.68.82




/var/named/named.ip

$TTL  86400
@  IN SOA  68.168.192.in-addr.arpa.     root.mail.fbe.net.  (
               200308016
               28800
               7200
               3600000
               84600      )

              IN        NS       mail.fbe.net.
              IN        MX   10   mail.fbe.net.

82            IN        PTR       mail.fbe.net.






改动的就这几个文件,现在上网可以,如果把/etc/resolv.conf里最后一个192.168.253.3去掉,重新启动DNS和网络,就打不开网页了,Ping 任何一个外网地址也显示找不到主机....


请高手指点,谢谢
发表于 2007-8-24 17:52:02 | 显示全部楼层
你的bind没有配置正确的forwarders吧?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-8-24 18:50:58 | 显示全部楼层
Post by orphen
你的bind没有配置正确的forwarders吧?


怎么配置?请说的详悉点好吗
回复 支持 反对

使用道具 举报

发表于 2007-8-24 21:38:58 | 显示全部楼层
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;
       [color="Red"] forwarders { x.x.x.x; x.x.x.x; };
};

加红的这一段配置一下试下
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-8-27 10:15:58 | 显示全部楼层
Post by elico_yqf
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;
       [color="Red"] forwarders { x.x.x.x; x.x.x.x; };
};

加红的这一段配置一下试下


红色的这段是有的

forwarders {192.168.68.82;};
回复 支持 反对

使用道具 举报

发表于 2007-8-27 23:10:17 | 显示全部楼层
你转发到自己是不行的,你自己解析不了的域名应该转发给上级DNS来解析。
修改“{” “}”中间的IP为可用的外部DNS。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-8-28 09:55:39 | 显示全部楼层
Post by orphen
你转发到自己是不行的,你自己解析不了的域名应该转发给上级DNS来解析。
修改“{” “}”中间的IP为可用的外部DNS。

可以设置2个吗? forwarder {192.168.68.82;192.168.253.3};

还有,我这个自己架设的dns为什么不能ping通外网的域名?是因为自己不能解析吗?
回复 支持 反对

使用道具 举报

发表于 2007-8-28 13:25:52 | 显示全部楼层
可以设置2个,但是你设置的应该是可以进行DNS解析的服务器。
不要设置自己本身的。
  1. forwarders { 192.168.253.3; x.x.x.x; };
复制代码
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-9-3 09:34:41 | 显示全部楼层
问题已经解决,谢谢 orpen,各位朋友。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-9-3 09:35:06 | 显示全部楼层
问题已经解决,谢谢 orpen,各位朋友。
回复 支持 反对

使用道具 举报

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

本版积分规则

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