Dusting off the Let's Use Linux posts, I rediscovered one that I would like to deepen. It is about the existence of namebench, a tool that allows testing different DNS and that is of tremendous help to speed up our Internet connection.
What is a DNS
The DNS server is like a phone book that stores people's phone numbers. In this case, what it stores is the IP number that corresponds to the Internet addresses through which we browse.
In this way, when you put www.google.com, the DNS server is the one that transforms that text into the IP number of the machine where the page we want to see is stored. We need DNS servers because, obviously, www.google.com is easier to remember than a long number.
On the other hand, it is important to understand that there is no single DNS server for everyone. There are what are called root servers, which are the ones who know where the "high-level" servers are in each of the zones into which the world was divided and who also store the "complete list" of IPs. There are only 13 of these servers in the world. Then there are the "top-level" servers that only store part of that list (generally associated with geographic factors -.ar, .be, etc.- or generic -.com, .gov, etc.).
There are many of these servers, there are even private initiatives (such as Google and the Internet providers -ISP- of each of the countries) that offer DNS services. These are the DNS servers that we generally use, since if they do not have the number searched, they transfer the query to another server and so on until they come up with an answer.
To summarize, choosing one or the other DNS can greatly impact the performance of your connection (both download and upload) since the longer it takes to transform the URL into an IP number, the longer it will take for our computer to access that page. .
How to choose the fastest DNS
namebench is a cross-platform tool that will help you find the fastest and closest DNS servers, depending on where the computer is located. What it does is run a very comprehensive evaluation, taking your web history, tcpdump output and other standardized data sets as a benchmark in order to provide a detailed report on each DNS and make a recommendation on which would be the best server and how much the connection would improve over the DNS currently in use.[warning] Be careful, the fastest server is not always the safest or the one that best protects your privacy. An alternative that balances speed, security and privacy is openNIC. [/ warning]
namebench it is free software and does not modify the system in any way.
En Debian / Ubuntu and derivatives:
sudo apt-get install namebench
En Arch and derivatives:
yaourt -S namebench
The rest, you can download the source code and compile it.
1. When executing the command namebench, it will open.
2. Login 127.0.0.1 en Nameservers and press the button Start benchmark, as seen in the image below.
3. Have a little coffee. When you return, you will see that a page has opened in your internet browser in which the report created by namebench is displayed.
It is truly a gem that is worth reading in detail.
Changing the DNS as recommended by namebench is usually a very simple task, but since it varies depending on the distribution you use, the easiest thing is to create the /etc/resolv.conf.head file by hand, and add the appropriate DNS.
Sometimes the speech matters less than the results. This is the before and after configuring my DNS server, as recommended by namebench.
Impressive isn't it? Anyway, it is worth clarifying that the results depend on many factors (how good is your current DNS, your location, the Internet speed provided by your ISP, etc.).
Más info: namebench