Menu Close

Speed up your web browsing by caching dns to your hard drive in ubuntu

Here’s a manual to speed up your web browsing by caching dns to your hard drive in ubuntu.

First install pdnsd, simply use apt-get by issuing the following command in an Ubuntu
Linux terminal window:

sudo apt-get install pdnsd resolvconf

As I mentioned, this will cache the results of DNS lookups to your hard drive and therefore
improve your web surfing speed. As a side not, don’t omit the "resolveconf" part (above).
If you omit it, then you may run into problems when different applications/programs are trying
 to access (or change) the configuration file (found at /etc/resolv.conf).

After the install is complete (it should be fast), edit that configuration file by issuing this
terminal command:

        sudo gedit /etc/pdnsd.conf

One of the significant change I made is:

        label = "OpenDNS";
        ip=208.67.222.222,208.67.220.220;

        To compare, here is what my complete edited pdnsd.conf file contains:

        global {
        perm_cache=512;
        cache_dir="/var/cache/pdnsd";
        max_ttl=604800;
        run_as="pdnsd";
        paranoid=on;
        # next setting allows ppp/ip-up update the name servers — ABa / 20040213
        status_ctl=on;
        server_port=53;
        server_ip="127.0.0.1";
        }

        #Edit these to be your own servers if wished:
        server {
        label = "OpenDNS";
        ip=208.67.222.222,208.67.220.220;
        proxy_only=on;
        timeout=10;
        }

        # if you installed resolvconf, and status_ctl=on
        server {
        label="resolvconf";
        }

        source {
        ttl=86400;
        owner="localhost.";
        # serve_aliases=on;
        file="/etc/hosts";

After saving your changes, you’ll need to restart the server by issuing this
terminal command:

        sudo /etc/init.d/pdnsd restart

If you get a message that pdnsd cant be restarted then type in terminal :

sudo gedit /etc/rc.local and add : pdnsd -d at the end of the file and then

reboot. pdnsd will started uppon boot.

Then of course, test that everything is working. I used the command:

        dig n00bsonubuntu.com

and here’s the result:
n00b@your-desktop:~$ dig n00bsonubuntu.com

; <<>> DiG 9.5.1-P2 <<>> n00bsonubuntu.com
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19841
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;n00bsonubuntu.com.            IN    A

;; ANSWER SECTION:
n00bsonubuntu.com.        9094    IN    A    195.47.247.177

;; Query time: 9 msec
;; SERVER: 62.179.104.196#53(62.179.104.196)
;; WHEN: Tue Mar 24 19:04:10 2009
;; MSG SIZE  rcvd: 45

n00b@your-desktop:~$

Enjoy!!

0 0 votes
Article Rating
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments