Using Firefox and other browsers to surf the internet in Ubuntu is much slower than surfing the Internet in Windows, but careful people will find that the slow time is spent on DNS lookups. Then we can cache DNS in the native computer, that is, a DNS proxy server is set up natively. Commonly used software is bind, Djbdns, DNSMASQ and PDNSD. Let us say, with PDNSD to set up a permanent DNS proxy server, so-called "permanent", that is, after the system restart, the native cache DNS still exist, no longer to find the real DNS to re-establish the cache.
1. Installation
sudo apt-get install PDNSD
When installing, it will ask you what configuration you choose, please select "Manual".
2, Configuration PDNSD
sudo gedit/etc/pdnsd.conf
Modify
server {
Label= "resolvconf";
}
For
server {
Label= "OpenDNS";
ip=208.67.222.222;
ip=208.67.220.220;
timeout=30;
interval=30;
uptest=ping;
ping_timeout=50;
Purge_cache=off;
}
Label= "OpenDNS";
where "OpenDNS" can be casually written, a logo, for future diagnosis;
ip=208.67.222.222;
ip=208.67.220.220;
These two lines can also be written as a line of ip=208.67.222.222,208.67.220.220, representing the real DNS server address, can have multiple.
The following parameters are used by default.
sudo gedit/etc/default/pdnsd
Modify the value of Start_daemon to Yes.
3. Add the DNS proxy server to resolver
sudo gedit/etc/resolv.conf
Add a sentence on the first line: nameserver 127.0.0.1
4. Prevent resolv.conf from being covered
If you have DHCP service enabled,
sudo gedit/etc/dhcp3/dhclient.conf
Remove
#prepend domain-name-servers 127.0.0.1;
The "#" in front.
If you are dialing the Internet, then
sudo gedit/etc/ppp/peers/provider
Add # to the front of the Usepeerdns, which is to comment out the statement. Prevent resolv.conf settings from being overwritten by PPPoE.
5. Start PDNSD
SUDO/ETC/INIT.D/PDNSD start
6. Testing
Dig www.baidu.com | grep time
The results showed:;; Query Time:1 msec
The original result:;; Query time:845 msec
How to solve the slow way of Ubuntu Internet