如何看linux网络慢,Linux下网速慢的问题

机器是双系统,分别是Windows XP 和 CentOS-5.3,问题是这样的,在windows 下网速很快,然后切换到Linux下网速就变得蜗牛爬一样慢,忍受了有些日子了。试过在Linux下重新装了网卡驱动,效果为零,问题依旧。不废话了,问题的根本原因是dns解析花费了大量时间,解决方法是利用dnsmasq建立dns 缓存。

1、安装dnsmasq

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结果

;; 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: 292

4.2dnsmasq启动之后执行dig结果

;; 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: 1100b1331709591d260c1c78e86d0c51c18.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值