logo Home | Search
Forums | Links | About | Contact
Free Utilities
Yahoo! Chat Help
Computer Tutorials
Emote Share
In Depth / Articles
 -Chat Clients - Safe?
 -Chat Help Newbies
 -Buffer Overflows
 -VeriSign SiteFinder
 -How DNS works
 -Formation of a URL
 -Transparent Proxies
 -Internet Anonymity?
 -HTTPS / SSL
 -SharpExt - C# YahELite

Resources

Printer Friendly Printer Friendly
E-Mail Friend E-Mail to friend
Smiley Utility 7.0 Smiley Utility 7.0
Hide Ad Hide Ads

The Domain Name System

Introduction

In a previous example, I have used telephone numbers as an example. Here, I shall use it again.
We remember our friends by their name, not their telephone number. The telephone number is meaningless, it's not a logical mapping to their name. The telephone number assigned to them is almost totally random. When we want to call a friend, we look his or her number up in our phone book. We can then call them.
The Internet works in a similar way. We name sites with domain names, but hehind them is an IP address. Although you do not do it yourself, a lookup is performed, and then the webpage is requested. The process may be slightly different, but it is listed below.

Domain Names

It would be inappropriate to remember this website as "217.204.37.10". It's hard to remember, and you would forget it within minutes. That's why we use Domain Names, to name websites, helpbytes.co.uk for this site. The domain name is in three parts helpbytes .co .uk. The .uk is the TLD(Top Level Domain). The domain name is not a logical mapping between the IP address and the domain, it's the address of the server I came to host on. I can keep the domain, and change hosts(along with IP) as many times as I wish. At this point, I would say it's still possible to enter this site just using the IP address. Unfortunately, that is not the case. Look at Virtual Hosting at the end of my file.

The Domain Name System

Such a setup requires a system. The DNS(Domain Name System) is the system that controls all this, and is the huge phonebook for the internet. Without the DNS, we would either all remember 217.204.37.10 or we wouldn't have the internet at all.

The distributed Domain Name System and Redundancy

It would not be possible to have one computer, in an office in London, doing the Domain Name lookups for the whole of the internet. The load on this server would be incredible, and it's just impossible. The Domain Name System is distributed over many many servers on the internet.
Because hardware fails, power can get cut, and other unforseen situations, a server may go offline. That means that server can no longer do requests, meaning the load is higher for other servers. So at each level of the Domain Name System, there are many servers.

Root Level DNS Servers

These are at the top of the System. They must be able to handle millions of requests per day. There are 13 of these servers, labelled from A to M. There is just one server above these, where these get their updated information, but that does not matter to us. These servers are distributed accross the world. If one of them goes offline, the other 12 will share the new requests.
These servers don't actually hold a great deal of information! They just hold the addresses of the servers which hold information regarding certain TLDs(Top Level Domains) such as .com .uk .us.

TLD Name Servers

This is the next level, these servers hold information about a specific set of domains. One server will hold details about .com domains, another .net. There are many of these servers. These will most likely still not actually contain the IP address of the domain name being looked for. They will however, contain the data on which name server does hold the details for a given domain name.

Host Name Servers

These are the name servers that most times actually hold the details which map the domain name, to an IP address. They will be maintained by the webhost for the domain name, or by yourself if you run your own DNS server. It will contain the IP address for the domain name given. It is possible for these to further contain other nameserver addresses, and the chain going further however.

How is a lookup performed

You don't have to do this lookup yourself. The Operating System will be able to handle the lookup request. First, a request is sent from your computer, to your ISP's(Internet Service Provider) DNS server. Your ISP's DNS server is what now has to do all the work. In turn, it goes to each level as described above, asks for info, updates its information then asks the next, until it gets returned the IP.

The details & Image The image below should help you to understand this concept.
Key
N/S: Name Server
TLD: Top Level Domain
ISP: Internet Service Provider
A..M: 13 (A-M) Root Servers
The Domain Name System
Full Information
1
Your computer makes a connection to your ISP's DNS Server, and asks for the IP address for the domain name, helpbytes.co.uk in this example. It then waits for it's response.
2
Your ISP's DNS server gets information about the TLD from the domain name. In this case, it's the .uk. It then asks one of the 13 root servers for the address of the nameserver that handles .uk queries. It receives it's response from the server. If the server cannot handle the query, your ISP's DNS server tries the next.
3
Your ISP's DNS server makes a connection to this address, and asks it where it can find information regarding helpbytes.co.uk. It's unlikely at this stage the actual IP will be given. Your ISP's DNS server will now take receipt of the nameserver that contains the actual data for helpbytes.co.uk
4
Your ISP's DNS server makes a connection to this new address, and asks it where it can find information regarding helpbytes.co.uk. At this stage, it's most likely going to receive the actual IP address of helpbytes.co.uk 217.204.37.10.
5
Your ISP sends you the IP address. Your computer can now connect to this IP address and do its intended job!

Long process

The process is quite long, but takes very little to perform, there is not much involved at each process. These servers are fast, speed of light compared to our dial up machines. But there are 100000000s of these processes a day, all taking resources on these computers. Most times it is asking for the same information. For example, if someone next on your ISP asks for www.google.co.uk the first thing the ISP DNS server would do is ask the root servers how to handle .uk, but it just did that. This is where the caching process comes in.

Saving Resources: Caching

When the ISP actually asks the root server for the server handling .uk domain names, the root server will return the address, and an amount of time the server can cache the address for. What this means, is that the server can make a note that any lookup for .uk domain should go to a certain nameserver, and not to bother the rootserver, until this time expires. This time is called TTL(Time To Live).
It can also cache commonly used domain names and their IP addresses. Imagine how many lookups an ISP may be required to do for www.google.com per day. The first time someone asks for www.google.com, it remembers the IP address, and on new requests, can return the IP immediately.

Multiple Servers

Because of the chances of a server going offline, multiple servers, probably at least 2, would be provided at each stage to the server with the query. This allows numerous to be tried if one of them does not or cannot respond.

Virtual Hosting

One website per IP addres per Server would mean a lot of servers and a lot of IP addresses. But to get around this, and to offer cheaper hosting, such a thing as Virtual Hosting exists. This is where a server may have 100s of people hosting on it. Because they are all known by the same IP address, it's not possible to access this site simply by typing the IP. Your browser, or other software, sends a HOST: header, which contains the domain name, so that the server can map the domain to the website.