免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2253 | 回复: 3
打印 上一主题 下一主题

[DNS] linux 5.5 64位bind9.3.6辅助DNS,客户端解析出错 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2013-06-07 17:46 |只看该作者 |倒序浏览
现有windows2003主DSN服务器一台,ip地址172.16.10.4
新搭linux 5.5 x64 系统搭bind9.3.6 作为辅助DNS服务器,ip地址172.16.10.98   

bind这台已经关闭防火墙、关闭selinux、在bind本机上ping内网的域名、外网的域名均正常出结果,但在以辅助DNS为首选dns的时候,客户端无法解析出公网的域名,内网的正常。下面上代码

[root@Bind etc]# cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#       enforcing - SELinux security policy is enforced.
#       permissive - SELinux prints warnings instead of enforcing.
#       disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
#       targeted - Only targeted network daemons are protected.
#       strict - Full SELinux protection.
SELINUXTYPE=targeted


[root@Bind etc]# cat /etc/resolv.conf
nameserver 127.0.0.1
nameserver 172.16.10.98



[root@Bind etc]# service iptables status
Firewall is stopped.


[root@Bind etc]# vi named.conf

//
// named.caching-nameserver.conf
//
// Provided by Red Hat caching-nameserver package to configure the
// ISC BIND named( DNS server as a caching only nameserver
// (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
// DO NOT EDIT THIS FILE - use system-config-bind or an editor
// to create named.conf - edits to this file will be lost on
// caching-nameserver package upgrade.
//
options {
        listen-on port 53 { 172.16.10.98; };
        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";

        // Those options should be used carefully because they disable port
        // randomization
        // query-source    port 53;
        // query-source-v6 port 53;

        recursion  yes;
        allow-query     { any; };
        allow-query-cache { localhost; };
};
logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};
view localhost_resolver {
        match-clients      { any; };
        match-destinations { any; };
        allow-transfer   { any; };
        recursion yes;
        include "/etc/named.rfc1912.zones";
};



以下是节选
[root@Bind etc]# vi named.rfc1912.zones



zone "abc.com" IN {
        type slave;
        masters { 172.16.10.4; };
        file "slaves/abc.com.zone";
        // allwo-upte { none; };
};

zone "16.172.in-addr.arpa" IN {
        type slave;
        masters { 172.16.10.4; };
        file "slaves/16.172.arpa";
};

zone "123.com" IN {
        type slave;
        masters { 172.16.10.4; };
        file "slaves/123.com.zone";
};

zone "7.16.172.in-addr.arpa" IN {
        type slave;
        masters { 172.16.10.4; };
        file "slaves/172.16.7.arpa";
};



在客户机上的日志

Jun  7 17:29:02 bind named[23680]: client 172.16.28.230#1393: view localhost_resolver: query (cache) 'www.xmdxkc.com/A/IN' denied

论坛徽章:
381
CU十二周年纪念徽章
日期:2014-01-04 22:46:58CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大牛徽章
日期:2013-04-17 11:17:32CU大牛徽章
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大牛徽章
日期:2013-04-17 11:17:47CU大牛徽章
日期:2013-04-17 11:17:52CU大牛徽章
日期:2013-04-17 11:17:56
2 [报告]
发表于 2013-06-07 18:54 |只看该作者
本帖最后由 chenyx 于 2013-06-07 18:55 编辑

allow-query-cache { localhost; };改成 allow-query-cache { any; };测试下

论坛徽章:
24
天蝎座
日期:2014-05-13 18:05:59IT运维版块每日发帖之星
日期:2015-11-26 06:20:00操作系统版块每月发帖之星
日期:2015-12-02 14:57:54IT运维版块每月发帖之星
日期:2016-01-07 23:01:56IT运维版块每周发帖之星
日期:2016-01-07 23:04:2615-16赛季CBA联赛之青岛
日期:2016-01-23 07:58:272016猴年福章徽章
日期:2016-02-18 15:30:3415-16赛季CBA联赛之北控
日期:2016-03-23 14:20:06IT运维版块每日发帖之星
日期:2016-04-01 06:20:0015-16赛季CBA联赛之吉林
日期:2016-06-28 13:51:54IT运维版块每日发帖之星
日期:2016-07-01 06:20:00IT运维版块每日发帖之星
日期:2015-11-23 06:20:00
3 [报告]
发表于 2013-06-09 11:57 |只看该作者
VIEW的設定有問題。O(∩_∩)O~

论坛徽章:
24
天蝎座
日期:2014-05-13 18:05:59IT运维版块每日发帖之星
日期:2015-11-26 06:20:00操作系统版块每月发帖之星
日期:2015-12-02 14:57:54IT运维版块每月发帖之星
日期:2016-01-07 23:01:56IT运维版块每周发帖之星
日期:2016-01-07 23:04:2615-16赛季CBA联赛之青岛
日期:2016-01-23 07:58:272016猴年福章徽章
日期:2016-02-18 15:30:3415-16赛季CBA联赛之北控
日期:2016-03-23 14:20:06IT运维版块每日发帖之星
日期:2016-04-01 06:20:0015-16赛季CBA联赛之吉林
日期:2016-06-28 13:51:54IT运维版块每日发帖之星
日期:2016-07-01 06:20:00IT运维版块每日发帖之星
日期:2015-11-23 06:20:00
4 [报告]
发表于 2013-06-09 12:00 |只看该作者
給你個小提示 設定了view 別忘記那個.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP