I was asked the other day, “How does DNS work?” The context of this question was a conversation about that new .XXX top level domain (TLD) and why someone would want to pre-register a trademarked name. Some examples of other common TLD’s would be “.com”, “.net” and “.org.”
Let’s start with purchasing the domain name. You will choose from a number of Internet name registrars. A couple of commonly known registrars are GoDaddy and NetworkSolutions. Once you have created an account, you will be able to search for available names and make your purchase. If the name you desire is not available, most registrars will suggest names to you that appear to be similar. Most of these registrars will give you check boxes or radio buttons to choose the TLD in which you wish your name to reside. Individuals will typically pick one and buy it while companies will buy the domain in all three most common TLD’s to prevent any confusion and to protect their brand.
Ok, so you’ve bought example.com from NetworkSolutions. The registrar will register the name with the central Internet Registry. (Historically, this is managed an organization called INTERNIC.) Now you want to edit that domain name and tell the registrar what DNS servers it is to use as authoritative when a DNS query is issued for your name. You should be prompted for a primary and a secondary resource. This is where you will enter the IP addresses of the DNS servers that you wish to resolve these names.
Now you have ownership of a domain name and have assigned an authoritative name source for that domain. Now you must define that domain name on your DNS server. Fortunately, DNS is very mature and most DNS servers will walk you through the process of domain creation in an intuitive fashion. Once your domain is created, now you will need to put your web server host in that domain. The most common host name for an Internet web server is WWW. So, WWW is the host portion of the name, EXAMPLE is the domain and COM is the TLD. So, the name looks like www.example.com. You are certainly not limited to WWW as the host name. It just seems to be the most commonly used host name and is therefore intuitive to most users in the Internet community. During this host creation process, you must assign the WWW host an IP address. This address will be given to you by an administrator or by your ISP depending on your circumstances.
So, you have purchased a name, assigned DNS servers to it, made it reachable to others on the Internet. But how does the user find you? How does their DNS server know where to look in order to find you?
In Figure1 below, you will notice there are several steps in order for a name to be properly resolved.
Figure 1
The steps follow the order in which standard network computing rules specify name resolution should occur. The first step is for the requesting computer to consult its local “hosts” file to see if it has the name defined. If it does not have the name defined, the next step will be to consult the local DNS servers that have been assigned to this computer via DHCP. These DNS servers could be corporate DNS servers managed by an in-house IT staff or DNS servers owned and maintained by your ISP, depending on your computing environment. If the local DNS servers are authoritative for the domain, meaning the DNS server has the domain locally defined, it will return an answer to the query. If the DNS server is not authoritative, the next step will be to issue a recursive query for the authoritative source for the domain. This recursive query will begin with the root name servers for the Internet. All DNS software that is currently shipping has all 13 root name servers pre-defined. The root name servers are not authoritative for any domain, they are merely aware of the name servers for all of the (240+) TLD’s. So they will return the address of a name server for the TLD in which the domain you are requesting lives. For instance, it will return the address of a name server for the .COM domain. The local DNS server, having received that information, will then query that name server for the authoritative source for the EXAMPLE.COM subdomain. The .COM name server will consult the Internet Registry for this information and return it to the requesting name server. Now the local DNS server has the address of the authoritative name server. It will now query that DNS server for the name WWW.EXAMPLE.COM. The authoritative name source will reply with the address of the host. The local DNS server will then give that information to the requestor and name resolution is complete.
Once a query is complete, the requesting host and the local DNS server will maintain a cache of this information for a specified amount of time. If this same query is issued before the cache is cleared, the resolution of the name will take place much more quickly and without having to issue a recursive query.
That is DNS in a nutshell. Happy computing J

No comments:
Post a Comment