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