Domain Name System (DNS)

DNS the Internet Phonebook

DNS the Internet Phonebook

In order to connect any two Internet-connected devices you need to have an Internet phonebook. DNS, is short for Domain Name System, and a domain name system is exactly that, it's a system for recording and retrieving information about all of the domains that make up the Internet or an intranet. Data communication devices are similar to telephones in that they have a number, like a phone number, assigned to them and that number uniquely identifies that device. In the field of data communications a device's unique identifying number is referred to as its Internet Protocol address or IP address for short. By knowing the device's IP address, it is possible for another data communication device to contact it from anywhere in the world, as long as both devices have access to the Internet.

There was a time before digital data devices when people used to memorize the phone numbers of people or places they called frequently. Similarly many network administrators might connect to a device in their network using its IP address, but most of the rest of the world won't know or use an IP address to contact a remote data communication device, we want to connect to a remote device by using its name. You are probably very familiar with a lot of these data communication device names like: www.amazon.com, www.google.com, www.youtube.com, or www.facebook.com.

This need to connect devices using a name is why a system needed to be developed which would keep track of all the device names and their corresponding IP addresses. The domain name system is the system used to record and retrieve the information needed to make the Internet work. Every time you type a Web address, [technically referred to as a Uniform Resource Locator (URL)], into a Web browser, that address has to be converted to the correct IP address of the device you are trying to connect to. When you're surfing the Net, it's a Web server's IP address that your computer needs to know in order to establish a connection to it. The domain name system (DNS) was developed by a bunch of really smart engineers and so therefore it is a very organized and structured system, yet surprisingly very simple to understand once you learn how it works.

An illustration of how the domain name system (DNS) works.
Figure 1: An example of how the domain name system (DNS) works.

Let's say you open your Web browser and you type in "www.amazon.com" (without the quotes obviously, because with the quotes it becomes a text search which is handled by search engines, but I digress). The way that data communication networks work is that all the data that flows through it is packaged in an envelope and that envelope contains two important addresses, 1) a MAC addresss, and 2) an IP addresss. The MAC address is used when the message only needs to travel to a device on the same network as the sending device. If the message needs to be routed to a device on a network different than the sender's, then its IP address and the receiver's IP address will be used to forward their message back and forth and through the many routers it must travel before it reaches its destination. But, before the sending device can put the IP address on the envelope of the message it wants to send, it needs to search a DNS server to find the IP address that goes with www.amazon.com.

This is where it gets interesting, remember that the Web address you typed is also known as a Uniform Resource Locator (URL), well it turns out that these smart engineers have arranged the Internet's DNS servers at two levels. The first level is known as the Top Level Domains (TLDs), you are probably familiar with some of the popular TLD names like: .com (pronounced dot com), .net (pronounced dot net), and .org (pronounced dot org), there are quite a few other TLD names like: .edu, .biz, .mil, and .gov plus two letter country codes like .us for United States, .jp for Japan, .fr for France, and .de for Germany. There are several DNS servers operating in each one of those top level domains. The Web address you type in your Web browser is sent to one of these DNS servers based on the address (URL) you type. In our example of amazon.com your Web browser sends a DNS request to the DNS server in the .com domain because that DNS server keeps track of all the domains that end with .com and stores all of their corresponding IP addresses. More specifically the .com DNS server has only the IP addresses for the registered DNS servers that operate on behalf of the second level domains that end in .com.

Getting a bit tricky I know, hang in there. In our example "Amazon" is the second level domain name in the Web address you typed. The domain name server at the .com top level domain has the IP address for all the DNS servers that Amazon has registered with it. The .com DNS server responds to your computer's DNS request with "hey you were asking for the IP address of Amazon.com's DNS server, right? Well here is the IP address you requested.

So far, so good. However, we still don't have the IP address we need to connect to the Amazon Web server, so our computer now sends a DNS request to the Amazon DNS server. We can do this because we just got the IP address of the Amazon DNS server from the .com DNS server. At the Amazon DNS server our request for the IP address which corresponds to the Web address of www.amazon.com is processed, this time using the "WWW" part of the URL. In amazon's DNS server they have recorded the fact that they have a server with the name of "WWW" and its corresponding IP address is 176.32.98.166. This information is sent back to our computer and now our computer can complete a connection to the Web server (WWW) at amazon.com because our computer finally has the all important IP address needed to be able to correctly address all messages it needs to send to the Amazon Web server.

An interesting point to notice is that Web addresses work backwards. The first step in reaching a Web site is to actually send a request to the .com DNS server. Next a request is sent to the Amazon DNS server, and then our third message was the actual request to retrieve the Web page from the Web server. Let's list the steps then in shorthand 1) .com 2) .Amazon 3) WWW - which is just the opposite of www.amazon.com.