Enter your email address:

Delivered by FeedBurner

Get a faster browsing experience - using a local caching DNS


StumbleUpon Toolbar

Update

Check the part II of these article, boost your internet connection II

Some days ago while I was on a business trip, and trying to work in the Hotel, the second day the Internet connection was really slow, (maybe some other guest was downloading a lot of information), while trying to look for some information on the web, it took lots of seconds to even get the IP of the pages I was trying to visit.

I decided that I needed a local DNS on my PC to improve at least a little my speed experience.

Installing Bind

apt-get install bind9

As soon as it is installed it is ready to answer your queries, but here is a example of my configuration.

directory "/var/cache/bind";

auth-nxdomain no;    # conform to RFC1035

zone "." {
        type hint;
        file "/etc/bind/db.root";
};
zone "localhost" {
        type master;
        file "/etc/bind/db.local";
};

zone "127.in-addr.arpa" {
        type master;
        file "/etc/bind/db.127";
};

zone "0.in-addr.arpa" {
        type master;
        file "/etc/bind/db.0";
};

zone "255.in-addr.arpa" {
        type master;
        file "/etc/bind/db.255";
};

with these configuration files Bind is configured to answer queries and cache them for the time the computer is on, or until the TTL parameter instruct it to flush the data,and get a new copy of the DNS record.

Well this is with Bind, but Bind will store its cache on the PC RAM which is good if you do not turn your PC off, but if you usually turn it of, or if this configuration is intended for a Laptop, so it is maybe better to use pdnsd

PDNSD will save its cache from RAM to a file and it will be read next time Linux is booted, so this is a great utility for Laptops or dial-up users, it is also great for ADSL or Cable users, it will boost your browsing speed.

Installation

apt-get install pdnsd

Configuration

Once pdnsd is installed on your system, it needs to be configured, here is my configuration file, which is located at:

/etc/pdnsd.conf

global {
        perm_cache=2048;
        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";
}


server {
        ip="200.87.61.83";
        timeout=60;
        interval=900;
        uptest=ping;
        ping_timeout=500;
        purge_cache=off;
        caching=on;
}
server {
        ip="4.2.2.2";
        timeout=60;
        interval=900;
        uptest=none;
        ping_timeout=500;
        purge_cache=off;
        caching=on;
}

server {
    label="resolvconf";
}

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

Once any of these servers is installed, Bind or Pdnsd there is only one step left.

If your PC gets its nameserver from a DHCP server, you will need to reconfigure dhclient.conf to make 127.0.0.1 your primary domain server.

Here is the file you need to edit

/etc/dhcp3/dhclient.conf

be sure that this line is uncommented.

prepend domain-name-servers 127.0.0.1;

This line will tell to dhclient to put 127.0.0.1 as your first name server and the ones passed by the DHCP server will follow it, as the second, third and so on options.

You can learn more reading dhclient.conf man page

Update

Check the part II of these article, boost your internet connection

as a suggestion of a reader of this site.

Trackback URL for this post:

http://www.go2linux.org/trackback/291
StumbleUpon Toolbar

 If you like this article, subscribe to our full rss

If this article was somehow useful for you, you can leave something in the tip's jar

Please post your question in our forum and use comments only to leave your comments about the article, thanks.

You have forgotten to

You have forgotten to mention Polipo. This in combination with pdnsd works wonders. Though the initial configuration is not that simple I meanwhile consider it mandatory for my setups. There is no gain anymore with separate browsercaches. Just use these two as a central instance and turn them off. Tested with systems as low as PIII@1 GHz with 512 MB Ram to more actual dualcores with up 2 GB Ram. I'm wondering why in hell the common desktop oriented distributions don't include it in their default setups with some sane settings. The time is ripe ;-)

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

Captcha
This question is for testing whether you are a human visitor and to prevent automated spam submissions.

This site is proudly hosted at Bluefur Hosting