使用dnsmasq来提升CentOS上网速度

1. 安装dnsmasq 
dnsmasq的官方网址是:http://www.thekelleys.org.uk/dnsmasq/doc.html。利用里面的下载链接下载dnsmasq-2.72.tar.xz安装即可。 

2. 配置dnsmasq 
CentOS打开System—>Administration—>Network
到DNS标签下添加一个新的DNS服务器:127.0.0.1,并且放在第一的位置上。原来的保留不变,只是挪一下位置,降一下顺序。 
The other way to do this is to edit /etc/resolv.conf file.Add an new line at the top of the /etc/resolv.conf file and the line looks like this nameserver:127.0.0.1 which means add a new dns server. 

3、启动、停止dnsmasq 
/etc/init.d/dnsmasp start 
/etc/init.d/dnsmasp stop 
/etc/init.d/dnsmasp restart 


利用/etc/init.d/dnsmasp start来启动或者配置修改后用/etc/init.d/dnsmasp restart来重新启动使dnsmasq生效。  

4、测试DNS缓存 

使用dig www.google.com来看看启动前后的时间对比

参考:

1. centos 网速慢的解决办法 http://blog.chinaunix.net/uid-25864516-id-3015998.html

附件:

下载

原文地址:https://www.cnblogs.com/liqipeng/p/4584810.html