Slow network speed in Linux

Source: Internet
Author: User

The machine is a dual system, respectively Windows XP and CentOS-5.3, the problem is that in Windows network speed is very fast, and then switch to Linux network speed becomes snail crawling as slow, endure for some days. I tried to reinstall the NIC Driver in Linux. The effect is zero and the problem persists. The root cause of the problem is that DNS resolution takes a lot of time. The solution is to use dnsmasq to create a DNS cache.

1. Install dnsmasq

The official website of dnsmasq is http://www.thekelleys.org.uk/dnsmasq/doc.html. Use the download link to download and install the SDK.

2. Configure dnsmasq

The configuration is quite simple, and no command line is required. Open System --> administration --> network in centos:

Add a new DNS server 127.0.0.1 to the DNS label and place it at the first place. The original retained remains unchanged, just move the location and lower the order.

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. Start and Stop dnsmasq

/Etc/init. d/dnsmasp start

/Etc/init. d/dnsmasp stop

/Etc/init. d/dnsmasp restart

Start/etc/init. d/dnsmasp start or use/etc/init. d/dnsmasp restart after Configuration modification to enable dnsmasq to take effect.

4. Test DNS Cache

4.1dnsmasq execute dig results before startup

Dig www.google.com

; Query time: 1 msec

; Server: XXX. XXX #53 (XXX. XXX) # Shield the real DNS address here

; When: Mon Aug 31 13:13:40 2009
; MSG size rcvd: 292

4.2dnsmasq execute dig results after startup

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.