rescached Documentation

.:: kilabit.org ::.

August 2010


Introduction

What Is rescached ?

rescached is domain name service cache, it caching internet name and address on local memory when running and in local disk when not running.

Features and Limitations.

rescached is not a reimplementation of DNS server like BIND. rescached primary goal is only to caching DNS queries and answers, used by personal or small group of users, to minimize unneeded traffic to outside network.

Features, Limitations,

Behind The DNS

A short story on how DNS work in your system.

When you opened some website, let say www.reddit.com, in a browser, the first thing that browser do is to translate name address www.reddit.com into an internet address (i.e.: 219.83.126.10) so browser can make a connection to www.reddit.com server.

How browser do that ? First, it will send query to one of DNS server listed in your system configuration (/etc/resolv.conf in Unix). Then, if your DNS server also "caching" the name that you requested, it will reply the answer (internet address) directly, if it is not then it will ask to their parent DNS server.

+----+      +----------------+      +------------------+
| PC | <==> | ISP DNS Server | <==> | Other DNS Server | <==> ...
+----+      +----------------+      +------------------+

If you browsing frequently on the same site, hitting the refresh button, opening a page on the same website, etc.; this procedures will always repeated every times.

To make this repetitive procedures less occurred, you can run rescached in your personal computer. The first time answer is received in your local computer, rescached will saved it in computer memory and any later request of the same address will be answered directly by rescached

+----+      +----------------+      +------------------+
| PC |      | ISP DNS Server | <==> | Other DNS Server | <==> ...
+----+      +----------------+      +------------------+
  ^^             ^^
  ||             ||
  vv             ||
+-----------+    ||
| rescached | <==//
+-----------+

The only request that send to your DNS server is the one that does not already exist in rescached.

How Cache In rescached Work

rescached in technical side of view.

Each of query and answer data in cache have a number of accessed field, which defined how the cache will be ordered in memory. The frequently queried host-name will be at the top of cache list, and less queried host-name will at the bottom of cache list. This, obviously, will make a cache list based on user habit (frequently accessed host-name), which effect on the search time on cache list: fast reply.

+-----+-----------------+
| #   | host-name       |
+-----+-----------------+
| 529 | www.reddit.com  |
+-----+-----------------+
| 233 | www.google.com  |
+-----+-----------------+
| ... |       ...       |
+-----+-----------------+
| 1   | www.kilabit.org |
+-----+-----------------+

The number of cache that rescached can hold in memory is depend on the value of cache.max in configuration file. When the number of cache in memory reached it cache.max value, it will remove all cache data that has the number of frequently accessed less than cache.threshold.

Installation

Prerequisite

Compiling From Source

$ git clone http://www.github.com/shuLhan/rescached.git rescached.git
$ git clone http://www.github.com/shuLhan/libvos.git libvos.git
$ cd rescached.git/src
$ ln -s ../../libvos.git lib
$ make

Installation

After program successfully build, you can install it manually or using make program.

Install using make program

Installing using make in linux system using init.d (I.e. OpenSuSE) use,

$ sudo make install

For Arch linux, which use rc.d, use,

$ sudo make install-arch

Manual Installation

Post Installation Configuration

Configuration

Controlling rescached Service

After rescached has been installed you can start, stop, and view status of rescached service using /sbin/rcrescached.

rescached Startup Option

All rescached startup option located in file /etc/rescached/rescached.cfg. In this file you can see some comment for any option and some possible value. This section will explain more about each option and how they effect rescached.