Ubuntu is slow to surf the internet. That's right. Don't doubt it, Ubuntu is really slower than Windows. Where is the slow?
In Ubuntu 9.10, when you use Firefox to browse the Web, you will find that in the bottom left corner of the status bar, a long time display: Looking up xxxx.com .... or connecting to xxxx.com information. The page remains blank at this time.
When this message finally jumps over, it is the fast transferring data from xxxx.com, soon,
The page appears complete. At this point we come to the conclusion that slow in DNS resolution, rather than slow in fetching web data.
Under Windows, DNS caching is turned on by default, so all resolved domain names are not likely to be connected to remote DNS servers for a short time, but are queried directly from the local DNS cache, which in theory is approximately 0 of the time to parse DNS. And Ubuntu does not have the default to turn on similar features. Therefore, we feel that the same machine, the same cable, Windows under the speed of Internet access than Ubuntu.
Therefore, the solution of Ubuntu online slow thinking is coming: We build a DNS proxy server in this machine, caching DNS. Linux is the common software to build DNS proxies: Bind, Djbdns, DNSMASQ and PDNSD. Here, we use PDNSD to illustrate.
1. Installation
PDNSD has been added to the source, the installation is very simple:
sudo apt-get install PDNSD
During the installation process, it will ask you what configuration you choose and choose Manual here.
2. Configure
sudo gedit/etc/pdnsd.conf
Modify
server {
Label= "resolvconf";
}
For
server {
Label= "resolvconf";
ip=61.233.154.33;
ip=211.98.4.1;
timeout=30;
interval=30;
uptest=ping;
ping_timeout=50;
Purge_cache=off;
}
which
ip=61.233.154.33;
ip=211.98.4.1;
These two lines can also be written as a line of ip=61.233.154.33,211.98.4.1; On behalf of the local DNS server address, if you are on the campus network, then these two addresses is the network management aunt to you the DNS and backup DNS ...
can have multiple, according to their own situation to fill out. Here is the CRC's DNS.
The following parameters are used by default.
3. Set up DNS for this computer
sudo gedit/etc/resolv.conf
Insert a row before all content:
NameServer 127.0.0.1
In particular, if you are ADSL dial-up Internet access (via pppoeconf configuration), then you need to modify the file:
sudo gedit/etc/ppp/peers/dsl-provider
Add # in front of the usepeerdns and comment out. Prevent PPP from enforcing remote DNS and overwrite resolv.conf
If you enable the DHCP service, then
sudo gedit/etc/dhcp3/dhclient.conf
Remove
#prepend domain-name-servers 127.0.0.1;
Front of the "#".
4. Start PDNSD
SUDO/ETC/INIT.D/PDNSD start
5. Simple test
Dig yahoo.com | grep time
The first results show that:;; Query Time:11 msec
The second result shows:;; Query time:0 msec
The third result shows:;; Query time:0 msec
The fourth time results show:;; Query time:0 msec
The nth results show:;; Query time:0 msec,
At this point, our local DNS proxy server has been built successfully. Of course, this does not mean that the speed will
Immediately get promoted. But when Firefox accesses a page under the same domain for the second time, looking up xxxx.com .... or connecting to xxxx.com ... The time has been almost 0. Now our Ubuntu Internet speed is comparable to that of Windows.
The above is transferred from: http://lookluk.blogbus.com/logs/56313765.html
I myself follow the above method experiment, the fourth step did not succeed, prompt "not start PDNSD"
But thankfully, the fifth step was successful ... In other words, it achieves the desired effect.
Ha ha..........
If the settings are successful and restart again, there may be problems with DNS unresolved. This can be resolved using the following methods.
When you use NetworkManager to set up a network card, the DNS automatically zero when you restart the system, and resetting DNS after each reboot is cumbersome.
And the nameserver configuration file is/etc/resolv.conf
This is the normal content:
# Dynamic resolv.conf (5) file for glibc resolver (3) generated by resolvconf (8)
# do not EDIT this FILE by HAND-YOUR CHANGES would be overwritten
NameServer 202.102.152.3
NameServer 202.102.152.3 was removed after the reboot.
By the # Dynamic resolv.conf (5) file for glibc resolver (3) generated by resolvconf (8)
It can be seen that the resolv.conf is produced by resolvconf. Edit Vim/etc/resolvconf/resolv.conf.d/head File
Display the same content as resolv.conf:
# Dynamic resolv.conf (5) file for glibc resolver (3) generated by resolvconf (8)
# do not EDIT this FILE by HAND-YOUR CHANGES would be overwritten
At the end type nameserver 202.102.152.3
Save Exit,
Resolvconf-u
At this point can be normal Internet, restart after the DNS is not reset.
Transferred from http://hi.baidu.com/step_1/blog/item/bad960f53b2c6337bd3109b2.html