Some have heard about DNS and perhaps once configured in a router without knowing what it is or how it works. Others might know it, but haven’t considered to use another DNS server than the one of their ISP. This is what I will go through in this blog post.
DNS simply stands for Domain Name System, which is a hierarchy of Name Servers that have the intent to translate host names into IP addresses on a global scale. A name server hosts and/or caches these translations. In the case where they are at least hosted, the name server is often called a “DNS Server”. If you gave the host name
superuser.com to a DNS server, it would give you an IP back. In our case, that would be something like
How does it work?
The following image by Nirlog.com explains this very well:
Can you give an explicit example?
Let me give you an example on resolving
superuser.com in a non-cached way:
The name server that I use is
192.168.1.1; this is my local router which caches DNS entries. I gave it a Hosts file to reroute malicious domains. Here is an example, although I am using a different one which I can’t find anymore. I might update this post later to include it though…
The router has the name servers 188.8.131.52 and 184.108.40.206 set, known as Google Public DNS.
Google Public DNS will contact authoritative root name servers (ARN), which are the top of the DNS hierarchy. Then Google DNS will contact the
.comname servers, the IP of which it received from the ARNs. After that, Google DNS will contact the DNS server for
superuser.com, the IP of which it received from
A simple run of
NS1.SERVERFAULT.COM NS2.SERVERFAULT.COM NS3.SERVERFAULT.COM
The IPs for these name servers are known as they are registered at the
.com name server. When you register a new domain, you always have to fill in the DNS servers that you use, along with their IP.
- Google DNS will contact the DNS servers of
superuser.comto find the IP of
superuser.com, after which we finally get the IP I mentioned above:
nslookup superuser.com NS1.SERVERFAULT.COM Server: NS1.SERVERFAULT.COM Address: 220.127.116.11
Name: superuser.com Address: 18.104.22.168
Where can I find more information on DNS?
The name server terms are also used in different contexts, read Spiff’s answer for more.
So, as there is more than one DNS server, can I pick a different one?
It is a common misconception that an ISP that is closer to you is always faster and more secure: A short distance does not make up speed on its own nor does it make up security. Compare using the old single network cables out of metal to the newer multiple glass fibre cables systems, used in connections like EuroDOCSIS 3.0.
Other than propagation delay, you also have a processing delay on the server; I’m pretty sure that the DNS server at an ISP is less powerful to a DNS server hosted by Google, hence it is completely possible or a server that’s at a much greater distance will actually be faster than your ISP’s DNS server.
Hosting your DNS router/server yourself might be the fastest, though it wouldn’t have all the DNS records stored, which would make it not usable to surf the internet!
namebench by Google can help you pick out a better DNS server:
Are you a power-user with 5 minutes to spare? Do you want a faster internet experience? Try out namebench. It hunts down the fastest DNS servers available for your computer to use. namebench runs a fair and thorough benchmark 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. This project began as a 20% project at Google. namebench runs on Mac OS X, Windows, and UNIX, and is available with a graphical user interface as well as a command-line interface.
Here is the most important screen you will see when using namebench:
See their website for more screens. There is also a command line version available.
As an alternative, there is also DNS-Benchmark by GRC.
Caution though, it could be that DNS servers result in slower browser experience in some cases, but as I haven’t seen scientific proof on that, I would take that with a grain of salt. Many people have used more popular DNS servers like Google Public DNS and OpenDNS and haven’t had a problem with it. They are extremely fast and secure and I don’t notice any negative speed differences when surfing myself (with Google DNS).