机器是双系统,分别是Windows XP 和 CentOS-5.3,问题是这样的,在windows 下网速很快,然后切换到Linux下网速就变得蜗牛爬一样慢,忍受了有些日子了。试过在Linux下重新装了网卡驱动,效果为零,问题依旧。不废话了,问题的根本原因是dns解析花费了大量时间,解决方法是利用dnsmasq建立dns 缓存。1、安装dnsmasqdnsmasq的官方网址是:http://www.thekelleys.org.uk/dnsmasq/doc.html。利用里面的下载链接下载安装即可。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缓存4.1dnsmasq启动之前执行dig结果dig www.google.com;; Query time: 1 msec;; SERVER: xxx.xxx.xxx.xxx#53(xxx.xxx.xxx.xxx) #这里屏蔽真实DNS地址;; WHEN: Mon Aug 31 13:13:40 2009;; MSG SIZE rcvd: 2924.2dnsmasq启动之后执行dig结果dig www.google.com;; Query time: 0 msec;; SERVER: 127.0.0.1#53(127.0.0.1);; WHEN: Mon Aug 31 13:16:02 2009;; MSG SIZE rcvd: 110Linux下启动Java进程并获得PIDRedHat Linux下DNS配置文件获取方法相关资讯 CentOS
- CentOS虚拟机NAT静态IP设置 (07/04/2013 17:09:32)
- CentOS 格式化新硬盘并设置开机自 (07/04/2013 16:50:50)
- 服务器为何用CentOS不用Ubnutu (02/24/2013 15:19:10)
| - CentOS /usr/libexec/gconf-sanity (07/04/2013 17:07:42)
- 为什么我们选择CentOS而不是Debian (06/06/2013 06:19:40)
- 在CentOS下搭建Android 开发环境 (02/18/2013 09:14:14)
|
本文评论 查看全部评论 (0)