DNS Primer
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.clearcenter.com) and a system's IP address (e.g. 69.90.141.78). However, different services use different types of mappings or records. The example below will walk you through a configuration for a typical server.
Understanding DNS Records - By Example
Let's go through a typical example. You have just registered example.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://example.com and http://www.example.com.
- You have a password protected file share web site at files.example.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.example.com as the name for VPN connections.
- You have a video camera connected to the Internet with a static IP - 69.90.141.79.
The DNS configuration for this set up is shown in the table below. Don't worry about the details yet… keep reading!
A Records | |
---|---|
example.com | 69.90.141.78 (your primary server) |
camera.example.com | 69.90.141.79 |
CNAME Records | |
remote1.example.com | cr624222-a.someisp.com |
files.example.com | example.com |
www.example.com | example.com |
mail.example.com | sample.com Don't do this… see why below |
MX Records | |
example.com | example.com (not intuitive!) |
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.
In our example, the ClearOS system is hosting example.com. Using the Dynamic DNS tools, you would set your domain to be example.com and the IP address (69.90.141.78) will be automatically updated via dynamic DNS. For your camera, you need to create a static A record with the IP address (69.90.141.79) associated with camera.example.com.
So, you have two names mapped to IP addresses (A Records):
- example.com - 69.90.141.78
- camera.example.com - 69.90.141.79
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 can map a domain name to another domain name. In the example, you have:
- files.example.com - example.com
- www.example.com - example.com
- remote1.example.com - cr624222-a.someisp.com
What are the advantages of CNAMEs? You can map multiple domain names mapped to one - sometimes dynamic - IP address. In our example, files.example.com and www.example.com will now be associated with example.com's IP address (our first Dynamic DNS 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
MX Records (Mail eXchanger 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 [email protected]. 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 ClearCenter Mail Backup service sto backup your mail when your network is offline.