背景:
阅读新闻
精解Linux RHEL 6.x DNS 服务器
[日期:2013-08-17] 来源:Linux社区 作者:litaotao [字体:]
五、DNS的转发
###jie.com服务器的主配置文件###########
options {
// listen-on port 53 { 127.0.0.1; };
// 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 { localhost; };
recursion yes;
forward only; //只允许转发
forwarders { 172.16.122.4; }; //转发到ltt.com服务上
// 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";
######区域文件和区域解析文件还是之前的文件内容##############
##########ltt.com服务器的主配置文件######################
options {
// listen-on port 53 { 127.0.0.1; };
// 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 { localhost; };
// recursion yes;
allow-recursion { 172.16.22.2; }; //只为jie.com服务器进行递归查询
// 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";
##############ltt.com服务器的区域配置文件的部门内容###################
zone "ltt.com" IN {
type master;
file "ltt.com.zone";
};
#################ltt.com服务器的区域解析文件的内容###################
cat /var/named/ltt.com.zone
$TTL 1D
@ IN SOA dns.ltt.com. admin.ltt.com. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
IN NS dns.ltt.com.
dns IN A 172.16.122.4
www IN A 172.16.122.40
www IN A 172.16.122.140
www IN A 172.16.122.240
ftp IN A 172.16.122.200
mail IN A 172.16.122.250
###注意文件的属组和权限######################3
[root@PC ~]# grep -v "^#" /etc/resolv.conf | grep -v "^$"
search com
nameserver 172.16.22.2
[root@PC ~]# host -t A
has address 172.16.122.240
has address 172.16.122.40
has address 172.16.122.140
小结:实际工作中,你的转发的IP一般设置为运营商的DNS服务器的IP地址,运营商的DNS服务器可以接受你的转发
CentOS 6.4安装配置Nginx+Pcre+php-fpm
Ubuntu下用libvirt安装KVM虚拟机时找不到/bin/qemu-kvm问题解决
相关资讯 DNS服务器 RHEL6 DNS服务器
本文评论 查看全部评论 (0)
尊重网上道德,遵守中华人民共和国的各项有关法律法规 承担一切因您的行为而直接或间接导致的民事或刑事法律责任 本站管理人员有权保留或删除其管辖留言中的任意内容 本站有权在网站内转载或引用您的评论 参与本评论即表明您已经阅读并接受上述条款
评论声明
最新资讯