LinuxSir.cn,穿越时空的Linuxsir!

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

如何设置dns只对指定的域名转发?

[复制链接]
发表于 2010-6-22 09:04:51 | 显示全部楼层 |阅读模式
我想dns只对baidu.com及子域名进行递归查询,请问如何设置,下面是我的设置文件!

操作系统:CentOS 5.5
BIND版本:
[root@localhost ~]# rpm -qa bind*
bind-9.3.6-4.P1.el5_4.2
bind-chroot-9.3.6-4.P1.el5_4.2
bind-libs-9.3.6-4.P1.el5_4.2
bind-devel-9.3.6-4.P1.el5_4.2
bind-sdb-9.3.6-4.P1.el5_4.2
bind-libbind-devel-9.3.6-4.P1.el5_4.2
bind-utils-9.3.6-4.P1.el5_4.2

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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; };
allow-query-cache { none; };
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
view localhost_resolver {
match-clients { any; };
match-destinations { any; };
recursion yes;
include "/etc/named.rfc1912.zones";
};

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
named.rfc1912.zones配置内容如下:

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

zone "localdomain" IN {
type master;
file "localdomain.zone";
allow-update { none; };
};

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 "baidu.com" IN {
type forward;
forwarders { 202.106.0.20; };
};
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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