On the Internet all devices connected to the network are identified by the IP. Computers, servers, phones, routers, firewalls, all of which have an IP. IPv4 is a series of four numbers separated by periods. Type 128.56.47.12. As this is quite tedious memorization and impractical because words are better memorized domain servers. Here are some Internet-connected computers that have a list of names and corresponding IP.

When we go for example to ubuntux.info , your browser query to a server domain names, probably facilitated by the Internet access provider, and he responds with the IP corresponding to ubuntu.info. With the IP and the browser can access ubuntu.info . This is true for any domain name.

In the loading of each web page this is done many times for each domain name you have in it. The sum of all these inquiries rather adds time than it used to display the page.

We can install in our computer server domain names, and that these inquiries are made directly to him. Being on our own server computer queries are resolved much faster. If our server ignores the IP of the consultation he will ask an external server. This means that the server will query the server to cache the external domain name.

The most important is BIND9 server. Let's install it. Open a terminal from Applications -> Accessories -> Terminal or by pressing CTRL + ALT + T. We write in the terminal the following commands to install BIND9:

sudo aptitude update && sudo aptitude -y install bind9 dnsutils

To function as a DNS cache server must edit a single file. We opened for editing with:

sudo gedit /etc/bind/named.conf.options

And we in the group forwarders, to let him edit it like this:

forwarders {
8.8.8.8;
8.8.4.4;
};

Here I am using the Google name servers, which are 8.8.8.8 and 8.8.4.4. We can use our internet service provider or other we deem appropriate.

Restart BIND9:

sudo /etc/init.d/bind9 restart

Finally we must configure in System -> Preferences -> Network Connections. This will depend on our supplier and how we connect. We must put in domain name servers DNS our own equipment, ie 127.0.0.1. Serve the image below as a guide:

We can also edit:

sudo gedit /etc/resolv.conf

and add another entry to the top:

nameserver 127.0.0.1

Testing

To prove that this function can use the dig command. The first time we use will show a response time of tens of milliseconds. Once BIND9 register the new domain name will be the answer in a few milliseconds. For example:

dig ubuntux.info | grep "Query"

The first time I answered the 78ms, the second in 0ms.