DNS - Primer

Contents

Overview

The Domain Name System (DNS) is not difficult to understand, but you do have to take a little time to learn some of the rules. Basically, DNS is used on the Internet to map names to IP addresses. A mapping is simply an association between a system name (e.g. www.clarkconnect.com) and a system's IP address (e.g. 216.40.215.42). However, different services use different types of mappings or records. The example below will walk you through a typical setup for a typical server.

Understanding DNS Records - By Example

Let's go through a typical example. You have just registered sample.com as your domain.

  • You use your primary system as a web server and a mail server.
  • The web server is to be accessible at http://sample.com and http://www.sample.com.
  • You have a password protected MP3 web site at mp3.sample.com.
  • Just in case, you also want to specify a backup mail server.
  • You have a remote office with a cable modem connection, and you want to use remote1.sample.com as the domain name.
  • You have a hot tub connected to the Internet with a static IP - 128.2.11.43. You can pre-warm the hot tub over the Internet by sending an encrypted signal to this IP address.

The DNS configuration for this setup is shown in the table below. Don't worry about the details yet... keep reading!

A Records  
sample.com 216.40.215.42 (your primary server)
hottub.sample.com 128.2.11.43
CNAME Records  
remote1.sample.com cr624222-a.someisp.com
mp3.sample.com sample.com
www.sample.com sample.com
mail.sample.com sample.com Don't do this... see below
MX Records  
sample.com sample.com
sample.com mxbackup.pointclark.net

A Records / Host Records

The bread and butter behind the DNS system is the A record. The A record (address record, or host record) maps a domain name to an IP address on the Internet. All systems configured in your account are - by default - A records.

In our example, you would set your primary system for your domain: sample.com. The IP address (216.40.215.42) for sample.com will be automatically updated if you have a dynamic IP! For your hot tub, you type in the static IP address (128.2.11.43) to be associated with hottub.sample.com.

So, you have two names mapped to IP addresses (A Records):

  • sample.com - 216.40.215.42
  • hottub.sample.com - 128.2.11.43

CNAME Records / Alias Records

CNAME records (Canonical Name records) act as aliases for hostnames. Instead of mapping a domain name to an IP address (an A record) you map a domain name to another domain name! In the example, you have:

  • mp3.sample.com - sample.com
  • www.sample.com - sample.com
  • remote1.sample.com - cr624222-a.someisp.com

What are the advantages of CNAMEs? You can map multiple domain names to one - sometimes dynamic - IP address. mp3.sample.com and www.sample.com will now be associated with sample.com's IP address (our first A record). In the case of the remote office, you change a not-so-easy-to-remember-super-long domain name into something better.

MX Records / Mail Records

The Mail eXchanger record (MX record) tells mail systems how to handle mail that is addressed to a particular domain. Like CNAME records, the MX record maps a domain name to another domain name.

In the example, we use our primary machine as a server for mail to xyx@sample.com. Every MX record is tagged with a priority number. The MX record with the lowest number is the primary mail server. If the primary server is unavailable, the backup mail server (also called a "secondary mail server") will queue the mail. You can use the Mail/MX Backup to backup your mail when your server is offline.

Warning! 
  Mail servers must be an A Record! You might be tempted to use an alias/CNAME like mail.sample.com for your mail server... Don't do it! MX records must be pointing to an A Record.  
 


Conclusion

DNS isn't so hard to understand after all. If you want to learn more of the nitty-gritty details, please follow the link below:

Retrieved from "http://wiki.clarkconnect.com/docs/DNS_-_Primer"

This page has been accessed 10,895 times. This page was last modified on 16 November 2007, at 21:33.