DNS Basics

When you fire up your favorite web browser and type a domain name into the location bar there are several things that happen in order to take you to the page you would like.
One of the biggest players in the process to get you where you want to go is called DNS (Domain Name System).
In order for DNS to work effectively there are a few things that have to be set so that anyone that goes to a domain will end up in the right place.
It's my intention to give you a very basic overview of how this process works, and then I'm also going to through in a few basic term definitions. That way when you're conversing with Tech Support you won't have that "deer in the headlights" look on your face.
DNS Voodoo for a 5 year old
For our purposes, name servers are where the fun begins. When you type in a domain name into your web browser, the domain name is looked up and then then name servers are returned. The name servers are then queried for the IP address of the server the domain name currently resides on. Once your browser has that IP address it sends a request to the server and the server says: "yeah, I know this guy, here's where you can find his files." From that point your web browser moves to that server and starts sending you the files based on how the site is built.
Pay no attention to the man behind the curtain
How does the name server keep track of where to point everything?
It has what is called a zone file, it keeps track of entries for a single domain. This file contains everything DNS related for that domain. A basic zone file will generally reference the name servers the file should be stored on. It also has all sorts of fun things like the Mail eXchange Record (MX Record), the most important piece of information it has however is the A record. This is what points the way home for the domain name.
It can be thought of like this: alltech-nologic.com points to -> 69.4.225.143
Extremely simple, yet vitally important.
As a general rule, if you're using a shared hosting account all you'll need to do is point the name servers to the one your hosting company specifies. The name servers will define the standard records, which in most cases are all you'll need to worry about.
I just flew in and boy are my arms tired!
A common misconception on the internet is that everything is instant.
Well it's not, especially in the case of DNS, it has what is called a Time To Live (TTL) this is a number specified in seconds. That number is counted down then a new DNS update is pushed out to the internet.
The TTL is important to understand because when DNS changes are made, such as pointing the MX record to a new server for instance, the changes will take time to propagate throughout the internet. How much time it takes depends on the the TTL at the name server as well as how often the routers between the name servers and the people connecting update their routing information.
The closer you are to a particular server, the faster the changes will be seen by you.
If you live far enough away the changes to a zone file can take more than 24 hours in some cases.
If you change your name servers those changes can take up to 2 days to show up.
Watch your language bub!
Some common types of records and what they pertain to are:
A Record: This is the basis for pretty much every record in the file, other records like CNAME's and MX Records will generally reference this record. These are used to point a domain to an IP address. You can also point subdomains to an IP address as well.
CNAME: I've also seen this called a domain alias. The most common example of a CNAME is the "www." in front of a domain name. These can point to the domain itself or they can point to other domain names. An example of this might be if I was running a Ventrilo server and wanted to have something attached to my domain name. I could point vent.alltech-nologic.com to server1.ventersvers.com.
MX Record: These are the Mail eXchange records, they tell mail servers where to send e-mail for a domain to. These are commonly a different server than the A record points to. They will generally point to a subdomain such as mail. These records only have to do with incoming mail.
SPF Record: This is an anti-spam measure that can be put in place. It won't generally stop you from receiving spam, but what it will do is allow servers that are configured to check SPF records to verify that the e-mail came from who it says it's from. What this amounts to is a list of IP addresses that are authorized to send e-mail on behalf of a domain. Anyone that is not authorized is assumed to be sending spam.
Those are probably the 4 most common types of records you'll have to deal with.
Post a comment if you have anything to add or if you have anymore questions about DNS.