Name Server Introduction
From Initq
First implementation of DNS was called JEEVES. A later implementation was called BIND. BIND has been ported to most flavors of Unix and even to Windows.
Each node in the DNS namespace has a test label of 63 characters. A null label is reserved for the root. An absolute domain name is written with a dot at the end signifying the root. It is also called an FQDN.
The type of information retrieved when you use a domain name depends on the context in which you use it. Sending mail to someone at hp.com returns mail-routing information, which sshing to a domain name looks up the host information.
Contents |
Resource Records
The data associated with domain names is contained in resource records, or RRs.
Top level Domains
Original top level domains are com, edu, gov, mil, net, org and int. ISO 3166 establishes official, two letter abbreviation for every country in the world. New top level domains added after 2000 are aero, biz, coop, info, museum, name, pro. In 2005 two more were added, travel and jobs. More are being considered such as cat, mobi, post, You can check for current status of top level domains at http://www.icann.org.
Name Servers and Zones
The programs that store information about the domain namespace are called nameservers. Nameservsr have complete information about some part of the domain namespace, called a zone, which they load from a file or from another nameserver. Nameservers can be authoritative or multiple zones.
Namesrvers
There are two types of nameservers master and slave.
Zone Datafiles
The files from which primary master nameservers load their zone data are called zone files.
Resolvers
Resolvers are the clients that access nameservers. These are built into ssh or ftp.
Resolution
To give data about zones is called Resolution.
Root Nameservers
Root nameservers are the authoritative nameservers for each of the top level zones. The Job of a name server is to either give the answer to a query or provide information about how to get closer to the answer. Anytime a query is requested, the root namersvers are queried first. There are 13 root nameservers spread across the world at the moment. They are located at PSINet, NASA, two in Europe, one in Japan. Root servers receive ten thousand queries per second.
Here is how it works: Lets say you want to figure out the address of gun.spam.gov.au. The local name server queries the root nameserver. The root nameserver refers the query to the au nameserver. The local nameserver asks the au name server and it referred to the gov.au name server. The local nameservers queries the gov.au name servers and is referred to the spam.gov.au name server. Finally the local nameserver asks spam.gov.au name server and gets the address for gun.spam.gov.au.
Recursion
Queries come in two flavors, recursive and iterative. A recursive query means that a local nameserver keeps following referrals until it resolves an address. Just like the example above.
If your local nameserver is ben.edu and you request a query for ada.csci.ben.edu then the ben.edu nameserver will not have to consult the root nameservers. It should refer the query directly to csci.ben.edu.
Iteration
Iterative resolution does not require that much work. In iterative resolution a nameserver simple gives the best answer it already knows back to the querier. If the answer is not there then the names and addresses closest to the domain name in the query are passed on to the querier.
Choosing between Authoritative Nameservers
How does local nameserver pick a root nameserver among the 13 that out there? It uses a metric called roundtrip time, or RTT. Roundtrip time is a measurement of how long a remote nameserver takes to respond to queries.
Each nameserver is given a random roundtrip time value lower than any real-world value. This way all nameservers are queried at one time or another. When the nameserver responds, the RTT is recorded for future use. When all the namerservers have been queried then the one with the best RTT is locked for use.
Mapping Address to names
Address-to-name mapping produces output that is easier for humans to remember and understand. this use to be done in .rhosts or hosts files.
The Address-to-name is taken care of by in-addr.arpa record in nameservers. The IP address appears backward because the name is read from leaf to root. For example, if winnie.corp.hp.com's ip is 15.16.192.152, the corresponding node in the in-addr.arpa domain is 152.192.16.15. in-addr.arpa maps back to the domain name winnie.corp.hp.com.
http://www.internic.net/zones/in-addr.arpa.zone
Caching
Caching means to cache the result for future use. Negative caching means to to store the info that nameserver did not respond with an answer.
Time to Live
Cache data can't live forever. You get rid of it by using TTL.