Linux下網速慢的問題

來源:互聯網
上載者:User

    機器是雙系統,分別是Windows XP 和 CentOS-5.3,問題是這樣的,在windows 下網速很快,然後切換到Linux下網速就變得蝸牛爬一樣慢,忍受了有些日子了。試過在Linux下重新裝了網卡驅動,效果為零,問題依舊。不廢話了,問題的根本原因是dns解析花費了大量時間,解決方案是利用dnsmasq建立dns 緩衝。

    1、安裝dnsmasq

            dnsmasq的官方網址是: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: 292

        4.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: 110

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.