For Linux users, if you are constantly accessing some websites frequently, it would be ideal to set up a DNS Cache in your Linux box, rather than always relying on the DNS server to route your path to the destination. Basically, a DNS server resolves the domain name you requested and finds out the address regarding the domain and sends the correct route for you.
Instead of always depending on the DNS server, you can always depend on DNS cache to speed up the process of looking up domain names when browsing. The difference between them is probably about 50ms to 100ms, depending on your location. However, if you do constant surfing, and multiply that number by the number of times you send a request, chances are you can see how much it is worthwhile to set up the DNS cache to speed up browsing. In addition, setting up your DNS cache is not difficult at all.
The following instruction will demonstrates how to set up a DNS cache on your local computer. We assume you are using Debian-based (or Ubuntu) linux system
- Download the package dnsmasq which will be used for caching namserver lookups.
$sudo apt-get install dnsmasq - Access the following file at:
/etc/dnsmasq.conf
Uncomment the line that reads:
listen-address=127.0.0.1 - Next, edit the file at:
/etc/dnsmasq.conf
and ensure that the line "prepend domain-name-servers 127.0.0.1;" is without the comment "#". - Access and edit the following file:
/etc/resolv.conf
so that it looks like:
search yourisp.com
nameserver 127.0.0.1
nameserver 138.2.132.5
- Restart the dnsmasq service by running the command:
$sudo /etc/init.d/dnsmasq restart - To check if your DNS cache is working, run the following command:
$dig www.neohide.com
You would see something like "Query time: 46ms". Then, run the same command again, and you will notice that the result is "Query time: 1ms", which is way much faster.
What you see is the improvement in the time access to a certain domain, without having to go through the DNS server, which is mainly due to the DNS caching. So, have fun trying that out!






Post new comment