红联Linux门户
Linux帮助

centos搭建DNS转发服务器不成功,请老师们帮助排错!!!

发布时间:2012-08-26 13:28:42来源:红联作者:xdwlb
[i=s] 本帖最后由 xdwlb 于 2012-8-26 13:38 编辑 [/i]

环境描述:Centos6.3
BIND: bind-utils-9.8.2-0.10.rc1.el6_3.2.i686
服务器IP:192.168.1.100
搭建过程:
1、 安装dns服务器
yum -y install bind #yum安装
service named start #启动DNS服务 器
service named restart #重启DNS服务器
service named stop #停止服务器
chkconfig named on #设为开机启动
2、/etc/named.conf配置如下:
options {
listen-on port 53 { any; };
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query { any; };
recursion yes;

forwarders{202.102.152.3;202.102.154.3;}; #DNS转发

dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;

/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";

managed-keys-directory "/var/named/dynamic";
};

logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};

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

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

3、tail /var/log/messages
Aug 26 13:25:23 DNS named-sdb[30833]: automatic empty zone: 8.B.D.0.1.0.0.2.IP6.ARPA
Aug 26 13:25:23 DNS named-sdb[30833]: command channel listening on 127.0.0.1#953
Aug 26 13:25:23 DNS named-sdb[30833]: command channel listening on ::1#953
Aug 26 13:25:23 DNS named-sdb[30833]: zone 0.in-addr.arpa/IN: loaded serial 0
Aug 26 13:25:23 DNS named-sdb[30833]: zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0
Aug 26 13:25:23 DNS named-sdb[30833]: 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
Aug 26 13:25:23 DNS named-sdb[30833]: zone localhost.localdomain/IN: loaded serial 0
Aug 26 13:25:23 DNS named-sdb[30833]: zone localhost/IN: loaded serial 0
Aug 26 13:25:23 DNS named-sdb[30833]: managed-keys-zone ./IN: loaded serial 3
Aug 26 13:25:23 DNS named-sdb[30833]: running

4、测试
dig www.sina.com.cn

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.10.rc1.el6_3.2 <<>> www.sina.com.cn
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 38310
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;www.sina.com.cn. IN A

;; ANSWER SECTION:
www.sina.com.cn. 30 IN CNAME jupiter.sina.com.cn.
jupiter.sina.com.cn. 40 IN CNAME almack.sina.com.cn.
almack.sina.com.cn. 42 IN A 218.30.108.232

;; Query time: 10 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Sun Aug 26 13:37:29 2012
;; MSG SIZE rcvd: 92

5、客户端IP地址设置为192.168.1.100,DNS解析不了。

请各位老师帮助拍错,急用,谢谢谢谢!
文章评论

共有 8 条评论

  1. dlchengzi 于 2014-05-07 12:17:35发表:

    很好,很强大!

  2. Jarvis0911 于 2013-09-02 13:15:45发表:

    学习

  3. linux.wangwei 于 2013-08-29 21:47:06发表:

    啊哈受教了啊

  4. wujianguoshiye 于 2013-08-26 14:54:44发表:

    受教了

  5. nlgddt2046 于 2012-08-26 20:12:38发表:

    好不容易盼来的周末又过了哦,明天又是星期一,各位,你们玩够么?

  6. lovsher 于 2012-08-26 16:24:25发表:

    3# xdwlb


    小鸟受教了

  7. xdwlb 于 2012-08-26 14:13:58发表:

    问题已经解决,原来是centos6.3 防火墙的原因,打开防火墙把DNS勾选就可以了。

  8. xdwlb 于 2012-08-26 13:32:33发表:

    本人刚接触linux,请说的尽量详细一些