CentOS 6.5下 DNS分离解析
实验要求:
实现:为了简化实验网络结构,提供分离解析的DNS服务器配置有2个IP地址192.168.100.1/24(对内)和10.10.10.8/24(对外),以便模拟内部用户和外部用户连接。
推荐阅读:
----------------------------------------------分割线----------------------------------------------
一.安装软件包
# yum -y install bind bind-chroot
二.修改主配置文件
# vim /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;
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;
};
};
acl "lan" { 192.168.100.0/24; }; //定义内网acl
acl "wan" { ! 192.168.100.0/24; any;}; //定义外网acl
view lan { //定义视图lan
match-clients { lan; }; //适用于lan定义的客户机地址
zone "." IN { //一定要写在VIEW里面
type hint;
file "named.ca";
};
type master;
file "lan.zone"; //视图lan的数据文件
};
};
view wan {
match-clients { wan; };
zone "." IN {
type hint;
file "named.ca";
};
type master;
file "wan.zone";
};
};
include "/etc/named.root.key";