Featured post

Why should I learn Go?

Image
What is unique about GO language? Here are some of the advantages of GO programming language:           Code runs fast           Garbage collection           Simpler objects           Efficient concurrency Code runs faster: Before understanding why GO runs faster, let us know the process of software translation. Basically, we have three broad categories of languages:             Machine level language ·        Machine level language is a low-level language where instructions are directly executed on the CPU. Machine level instructions are small steps which are straight forward and simple (Ex: ADD, SUBTRACT, MULTIPLY ) Assembly language ·        Assembly language is similar to machine level language but a bit more specific for humans to understand. For example, 1000...

DNS (Domain name system) and Domain namespace





It is a system primarily designed to make computers easy to use for humans. In computing, every system has an IP address which is nothing but a series of numbers .DNS maps names to an IP address just like we map phone numbers to contact names. Like phone numbers it is easy to remember a couple but not all of them. Similar is the case with IP addresses. We may remember some of them but not all the IP addresses of all the computers in the world. DNS makes this easy. It is easy for us to remember names rather than large numbers. Before DNS was developed there was a file called hosts file which was used to map IP addresses with the system names. Before DNS was introduced, the hosts file needs to be copied among various systems when any changes were made. This is ok for few systems but as the internet grew longer and longer this became harder. The hosts file also grew longer and longer.

Before DNS:

DNS was first developed in 1983. It is a hierarchical distributed database that allows to find computers and services on the internet. It is considered to be hierarchical but not flat because we have multiple computers with the same name. For example, you could have 2 computers with the host name but will definitely has different fully qualified domain name. Older systems would allow only single name to a computer but as DNS developed this was different. In order to have a centralized but distributed name space, DNS is broken down into several parts and kept at various servers. For example DC1.example.com is divided into parts like example, com and stored at different servers. This allows decentralized administration while allowing centralized control.





DNS name space:


In order to understand what DNS is, first we need to understand clearly the term “Fully Qualified Domain Name”. A fully qualified domain name is a complete domain name. For example, www.facebook.com, www.efficientprogrammer.com, www.google.com and so on. So basically DNS is used to convert the name space www.efficientprogrammer.com into an IP address. To do this DNS uses a hierarchy of servers in order to determine the fully qualified domain name. Once it has resolved the name it is returned to the client. It is hard to estimate how many domain names are currently in use on the internet at a time. But estimates suggest that there are over 2 million domains currently in use. It is necessary to divide the name space to have a decentralized administration.


“So how does DNS divide the name space?”






At the root of the hierarchy there is a dot (.) .On the internet there are over 300 root servers which start resolving the name space. The major responsibility of the root servers is to help to resolve next part of the address. When looking at the DNS name, they are resolved from right to left. All the DNS end with a dot though you do not need to put a dot at the end. The dot is added automatically. The next part of the address is known as the top level domain. This contains the next part of the address which can be com, net, org and so on. The next part of the address is the second level domain. These can be registered by individuals or companies. This is where the individual or the company gets the administrative access. Once it is done, the individual can create fourth level domains such as www, ftp and so on.

In order to understand how a DNS resolves name space, let us consider an example of fully qualified name space www.efficientprogrammer.com.




When you type the above address in a browser, initially a dot is added automatically. (https://www.efficientprogrammer.com.) First the client sends a request to the DNS server for the IP address of the URL. The DNS server would then check if the IP address is available in its cache. If it is not present then it has to search for another server which has the information.
“So how does the DNS server know which server on the internet has the IP address of the requested namespace?  And how will it know that the information is considered correct?  The server which contains the information of the DNS names is considered as an authoritative DNS server. So how does the DNS server finds an authoritative DNS server which has the answer? Firstly the DNS server contacts the “root hint” server to know the address of the server which can resolve the .com addresses. The addresses of the root hint servers is pre built into the DNS server and this is how the DNS server knows where to start the process. Once the address of the DNS server which can resolve the .com addresses is known, the DNS server the sends a request to the .com server. This server will give the address of the DNS server which can resolve the domain name www.efficientprogrammer.com. With this information, now the DNS server can contact www.efficientprogrammer.com” and get all the information regarding the name space.






All the information regarding the namespace along with the IP address of the root hint server and the .com server is stored in the local cache of the DNS server. Most companies will orward the DNS requests to their ISP because the ISP DNS server resolves lot more name spaces than the actual company server. There is a better probability that the ISP’s DNS server might have already resolved the namespaces. This is a much more efficient way of resolving name spaces.


SUMMARY :

        The essence of DNS is the invention of a hierarchical, domain-based naming scheme and a distributed database system for implementing this naming scheme.
        It is primarily used for mapping host names and e-mail destinations to IP addresses but can also be used for other purposes.
        It is primarily used for mapping host names and e-mail destinations to IP addresses but can also be used for other purposes.
        The resolver sends a UDP packet to a local DNS server, which then looks up the name and returns the IP address to the resolver, which then returns it to the caller.
        Armed with the IP address, the program can then establish a TCP connection with the destination or send it UDP packets.
        Each domain is partitioned into subdomains, and these are further partitioned, and so on. All these domains can be represented by a treeThe leaves of the tree represent domains that have no subdomains (but do contain machines, of course).
        A leaf domain may contain a single host, or it may represent a company and contain thousands of hosts.
        The top-level domains come in two flavors: generic and countries.
        The original generic domains were com (commercial), edu (educational institutions), gov (the U.S. Federal Government), int (certain international organizations), mil (the U.S. armed forces), net (network providers), and org (nonprofit organizations).
        The country domains include one entry for every country, as defined in ISO 3166.




Comments

  1. Web address must connect you with a niche market which will allow you to display your website in a more efficient way. Your web address must assist you in creating traffic to your website. Creative Company Names

    ReplyDelete

Post a Comment

Thanks for your comments!

Popular posts from this blog

Introduction to Big Data and Hadoop

LocationManager vs GoogleApiClient

Why should I learn Go?