I recently stumbled upon an awesome tool called Namebench. Namebench it’s a small program wrote in python that search for the fastest DNS server near to you. Namebench runs benchmarks using your web browser history, tcpdump output, or standardized datasets in order to provide an individualized recommendation. Namebench is completely free and does not modify your system in any way. It’s currently a “Google” project.
The source are available on the official site, as wrote this is a python program so you should be able to run it from the command line without any additional package, if you want also the GUI you need also the package python-tk, this is usually available in all the main repositories of the principal distributions.
On Ubuntu 11.04, you can easily install it with:
$ sudo aptitude install namebench
The following NEW packages will be installed:
blt{a} namebench python-dnspython{a} python-graphy{a} python-jinja2{a} python-tk{a} tk8.5{a}
0 packages upgraded, 7 newly installed, 0 to remove and 0 not upgraded.
Need to get 3,234 kB of archives. After unpacking 11.1 MB will be used.
Run it from any command line or with a launcher. The nameservers field will already be populated with your current DNS servers taken from your resolv.conf.
In Query Data Source you can choose where to take the DNS names to be tested, from your browser history, Top 2000 Alexa sites or do other latency tests.
Once you have selected your options just click on Start Benchmark and wait, it took around 10 minutes on my computer to run all the the tests. For geeks, you’ll want to run this in a terminal and watch the output. At the end you’ll have a page with all the results and some nice graphs, but you are just interested at the information at the top. On the left you can see an estimation of how much you can gain in using the DNS server listed on the right side.
Now, modify your configuration…
Now that you know which DNS server to use you just need to change your resolv configuration file. On a terminal, simply edit /etc/resolv.conf.
In this file put the same IP addresses that tested best in the results of your benchmark, something like:
nameserver 127.0.0.1
nameserver 8.8.8.8
nameserver 4.2.2.1
Erik
Friday, September 23, 2011
linux administration - tips, notes and projects
No Comment