Speed up web surfing by using a DNS disk cache in Ubuntu

Offer yourself a faster browsing experience, courtesy of pdnsd.

We’ll use GoogleDNS as our caching servers for this matter, and no one could argue about its speed and security. You can use any DNS server you like, such as OpenDNS. Feel free to modify the parameters later.

Install the caching daemon

sudo apt-get install pdnsd resolvconf

Edit the pdnsd daemon script to enable

sudo pico /etc/default/pdnsd

Find and edit the line

# do we start pdnsd ?
START_DAEMON=YES

Now, edit the main configuration file

sudo pico /etc/pdnsd.conf

An example pdsnd.conf file would be:

global {
perm_cache=2048;
cache_dir=”/var/cache/pdnsd”;
run_as=”pdnsd”;
server_ip=”127.0.0.1″;
server_port=53;
status_ctl=on;
paranoid=on;
min_ttl=15m;
}
server {
ip=”8.8.8.8″;
timeout=60;
interval=900;
uptest=ping;
ping_timeout=500;
purge_cache=off;
caching=on;
}
server {
ip=”8.8.4.4″;
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”;
}
rr {
name=localhost;
reverse=on;
a=127.0.0.1;
owner=localhost;
soa=localhost,root.localhost,42,86400,900,86400,86400;
}

Save and restart the daemon

sudo /etc/init.d/pdnsd restart

Leave a Reply

Your email address will not be published. Required fields are marked *