首页 > 其他 > 详细

bind + dnsmasq 实现域名转发(部分主机)

时间:2014-02-21 15:07:18      阅读:474      评论:0      收藏:0      [点我收藏+]

1、bind配置:


/var/named/chroot/etc/named.conf


listen-on port 53 { 192.168.1.254; };

forwarders { 202.101.172.35; };
forward  only;

zone "test.com" IN {
       type forward;
       forwarders { 127.0.0.1; };
};



2、dnsmasq配置:


resolv-file=/etc/resolv.dnsmasq.conf   //使用自定义的nameserver文件
listen-address=127.0.0.1                     //监听IP,和bind监控的ip区分开    
bind-interfaces                                  //绑定开关
no-hosts                                            //不使用默认的/etc/hosts
addn-hosts=/etc/dnsmasq_hosts       //使用其他的自定义文件

mx-host=sky-mobi.com,pop.sky-mobi.com,50
localmx                                             //返还mx记录
conf-dir=/etc/dnsmasq.d



3、创建/etc/resolv.dnsmasq.conf


nameserver 8.8.8.8



4、创建/etc/dnsmasq_hosts


192.168.1.250  pop.test.com
192.168.1.250  test.com



     以上操作,就可以实现test域中pop.test.com及test.com的解析指向192.168.1.250,而域test其他主机解析,正常由bind正常转发并解析。


5、客房机测试:

dig test.com @192.168.1.254

dig pop.test.com @192.168.1.254

dig mx test.com @192.168.1.254


本文出自 “秋天的童话” 博客,请务必保留此出处http://wushank.blog.51cto.com/3489095/1361409

bind + dnsmasq 实现域名转发(部分主机)

原文:http://wushank.blog.51cto.com/3489095/1361409

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!