(2013-6-26)使用dnsmasq构建linux轻量的dns缓存服务器

(2013-6-26)使用dnsmasq构建linux轻量的dns缓存服务器

编辑文章

安装

yum -y install dnsmasq bind-utils

配置文件

主配置文件

mv /etc/dnsmasq.conf /etc/dnsmasq.conf.bak
wget -N -O /etc/dnsmasq.conf http://lihaixin.googlecode.com/svn/trunk/conf/dnsmasq/dnsmasq.conf

本文HTML永久地址 doc

增加google文件

wget -N -O /etc/dnsmasq.d/google.dnsmasq http://lihaixin.googlecode.com/svn/trunk/conf/dnsmasq/google.dnsmasq

配置静态域名对应ip列表

wget -N -O /tmp/hosts.dnsmasq http://lihaixin.googlecode.com/svn/trunk/conf/dnsmasq/hosts.dnsmasq

运行

dnsmasq --test
/etc/init.d/dnsmasq restart
chkconfig --level 345 dnsmasq on

测试

dig 126.com mx @127.0.0.1 +trace
dig www.google.com  @127.0.0.1

参考资料

http://blog.duxin.info/tag/dnsmasq/

没有评论 :

发表评论