DNS Primer
DNS Tutorial » Introduction to the Domain Name System
The Domain Name System (DNS) serves as the telephone directory of networks such as the Internet.While humans are comfortable with easy to remember Internet addresses such as www.tutorius.com (known as domain names or hostnames), our computers operate with numeric Internet Protocol (IP) addresses which appear as 4 numbers separated by periods (techies call this 'dotted quad') in a form like 192.168.0.1.The DNS system maintains directories relating the hostnames to the IP addresses.Here's how it works. When you go to visit a website like Tutorius.com, your web browser checks to see if it has been there recently, in which case the IP address might be cached or stored locally on your computer.
If it's not found, your computer looks outside to DNS servers provided by your corporate network or Internet Service Provider (ISP). If those servers can't provide the information they in turn look to a server farther upstream on the Internet. These searches are forwarded up the line until they find the address or determine that it doesn't exist.If the address is available, it's passed back to your browser. If not, you're receive a message telling you the hostname or domain is not available.A word is in order on the difference between host names and domain names.A domain name is the name an organization presents to the outsite world on the Internet. In this case that is tutorius.com.
Domain names exist in a hierarchical form. The Top Level Domain (TLD) inthis case is .com. There are many other TLDs; .org, .net etc as well as the Country Code TLDs, such as .ca for Canada, .uk for the United Kingdom, the rarely used .us for the United States.
Working backwards we come to the domain name, in this case tutorius. Any level in a domain name owns the 'namespace'
below it. That means that at tutorius.com we own and have full control over the namespace, or the range of all possible addresses, below it. So if we wanted to have a File Transfer Protocol (FTP) server to serve files (we don't at this point), we could call it ftp.tutorius.com.
This brings us to hostnames. A hostname is the name provided within a local network to each individual computer. We most often use hostnames with reference to servers. Within a corporate network DNS tracks hostnames, outside on
the Internet it tracks domain names, which may or may not have a hostname attached to them.
Beyond the Basics
Forward and Reverse Lookup
You may have heard references to Forward Lookup and Reverse Lookup.
Forward Lookup refers to the process of 'looking forward' from a hostname or domain name to lookup the IP address for it. This is essentially what we do when we pick up a telephone directory.
Reverse Lookup refers to the opposite process, finding the domain or hostname that relates to a known IP address. This is essentially what we're doing when we use one of the telephone reverse lookup services on the internet to enter a phone number and find the name and address that corresponds to it.
DNS servers maintain forward and reverse lookup zones, directories whick facilitate this process.
A forward lookup is used in the standard DNS queries described above. A reverse lookup is often used by email servers to combat spam.
When a message comes in, a server may to a reverse loopup on the IP address the mail came from. If it doesn't match the domain name the email claims to be coming from, the server may discard the message.
Caching
Once your computer or the DNS servers it has referred to have an IP for a domain or hostname, it will 'cache' it, or hold the information for a period of time.
This time will vary from system to system, but it is typically a fairly short time.
Why not keep it permanently? The principal reason for this is that IP addresses can change. You can learn more about that in the DHCP tutorial.
DNS Forwarders
We talked above about how if a DNS server cannot find the IP address for a hostname it will look "upstream" to another DNS server. Ultimately that search may reach up to one of the 13 fabled "Root Servers". These servers contain references for the DNS servers responsible for each Top Level Domain (TLD), such as .com, .net, .ca, .us, etc.
See also;