Wednesday, April 16, 2008

Domain Name Servers (DNS)

Pointing your DNS at the right location

Domain Name Servers (Or DNS for short) are a vital part of people being able to see your website. When you type in yourwebsite.com and hit the "Go" button your computer literally has no idea where the files are for that website. The first place it knows to look is your Internet Service Provider's (ISP) Name Servers. If your ISP's DNS does not see itself has the authoritative or "Owner" of the website it will then go out and ask the world where these files are. Eventually a name server that is queried will know the registrar that has the WHOIS record for the domain. This is an important step because once we get here if the Registrar has the wrong DNS for where your files are located then no one will be able to see your website. However, when it is correct the DNS will translate yourwebsite.com to the proper IP address of the server that is hosting the files and then send the information back to your browser.

These process seems very complicated, but can be done in fractions of a second.

Authoritative DNS Zone Record

The Name servers for anydomain.com contain various information for a domain that is stored in what is known as a Zone Record. These Zone Records contain A, MX, NS, and CNAME records.
The A record is the one that contains the correct IP address for a domain, so it is the one that maps yourdomain.com to 216.237.66.1 and allows people to view your page. A MX (short for Mail eXchangers) tells the world what mail server e-mail for anyone@yourdomain.com should be delivered to. As mentioned above the NS records are the Authoritative name servers for the domain. Finally the CNAME records acts as a type of alias which allows mail.yourdomain.com and mail.yourprovider.com to be actually the same thing.

Example of a Zone Record

Here is an example of a zone record we will break down to see where the various data is stored.

$TTL 1d ; Default TTL
OMITTED.com. 1d IN SOA ns.frii.net. hostmaster.frii.net. (

2008012205 ; Serial Number 2008/01/22 00:00:00
3h ; Refresh Rate
1h ; Retry Interval
7d ; Expiration
1d ) ; Negative Cache TTL

IN NS ns1.frii.net.
IN NS ns2.frii.net.
1D IN MX 0 a.mailarmory.net.
1D IN MX 1 b.mailarmory.net.
IN A 216.17.184.1
ftp IN CNAME ftp.frii.com
mail IN CNAME mail.frii.com
www IN A 216.17.184.1

We will start at the top and go down to analyze this zone record:

$TTL 1d - This is the Time To Live (TTL) that another DNS server will cache. The 1d implies that another name server should check back once a say

SOA - This is the Start of Authority and shows the Authoritative name server

Serial Number - This is for your hosting companies use

Refresh Rate - How long a secondary name server will wait to pull up the Zone Record again
Three hours as shown above.

Retry Interval - How long a secondary name server will wait if the try of the refresh rate was unsuccessful. One hour as shown above.

Expiration - How long a secondary name server will cache the zone record if it cannot be refreshed. Seven days shown above.

Negative Cache TTL - Same as $TTL

Below that are examples of the NS, A, MX, and CNAME records.


Next week we will talk about Hosting Companies and what they do for your domain!







No comments: