Setting up DNS For Cloud Servers With Rackspace

DNS is one of those things that seems like magic until you understand it. This post will first give a brief overview of how DNS works, and then walk through the steps of setting up DNS for a Cloud Server with Rackspace.

What is DNS?
In short, Domain Name Service (DNS) translates hostnames to IP Addresses. This is what allows us to simply type in joshprewitt.com instead of trying to remember 184.106.219.112.

A high level overview of DNS:
When a visitor requests a website such as www.JoshPrewitt.com, a query is made for where the Start of Authority (SOA) is. This is simply saying “Hey, where can I find some information about JoshPrewitt.com?” A response is made with the Name Servers. The Name Servers contain additional information on exactly what services are available on a domain. Common Name Servers are:
Rackspace Cloud: dns1.stabletransit.com and dns2.stabletransit.com
Rackspace Dedicated: ns1.rackspace.com and ns2.rackspace.com
GoDaddy: ns1.domaincontrol.com – ns60.domaincontrol.com (and maybe more. This many is just plain silly, but to each their own).

So now the requester goes to the NameServer and says “Hey! I’m looking for a website that will be under the name joshprewitt.com”. The Name server looks for a Zone for JoshPrewitt.com. If it finds it, it then looks for a record for exactly www.joshprewitt.com to tell the requester where to go next.

So to summarize:
NameServers contain Zones
Zones contain Individual Records

What are some common Record Types?
A: This is the biggie. An A record stands for address record and points a hostname (www.joshprewitt.com) to an IP address (184.106.219.112)
CNAME: Stands for Canonical Name. This is best described as an alias. It will point a hostname (google.joshprewitt.com) to another host name (google.com)
MX: Mail Exchanger record. This guy handles all email inquiries. Per the RFC (Think of it as Internet Law), this must point to a Host Name.

So, here are some examples to show you how DNS can chain together records to get where it is going.

Simple A Record
JoshPrewitt.com –> 184.106.219.112

CNAME record of www.joshprewitt to the A record of joshprewitt.com
www.JoshPrewitt.com –> JoshPrewitt.com –> 184.106.219.112

MX Record Example
JoshPrewitt.com –> mail.JoshPrewitt.com –>184.106.219.112

Ok, so now we have a basic understanding of DNS, and we know how the records can link together. How do we put this into practice?

Making it work

Let’s add a zone and some example records for a made up site: joshprewitt-test.com

First, add the zone:
1) Login to manage.rackspacecloud.com
2) Click Hosting > Servers > Choose any Server > Click the DNS tab
3) Click “Add”
4) You will be prompted for a domain name, enter the domain without a www. For example, I would enter: joshprewitt-test.com
5) Press “OK”

That’s it, the zone is added! Now, click the zone and you can manage the actual records. Rackspace Cloud does not add any records by default, so you must add the ones that you need!

Before we talk about the records we are going to add, let’s look at the DNS options that we are going to run into.

DNS Options

Name: This is what the record will be known as or what the user will type in to the address bar. Examples would be: joshprewitt-test.com, www.joshprewitt-test.com, mail.joshprewitt-test.com, etc

Content: This is where the Record will point. Think of it like this: A request comes in with a NAME and is directed to the CONTENT. For an A record, this will always be an IP address, usually the IP address of your server. For a CNAME or MX Record, this will always be a hostname.

TTL is Time To Live. This is the value in seconds for how long you want this record to be cached. The higher it is, the longer it will be cached, so performance will slightly improve. We usually suggest 3600 as TTL because this is 1 hour. This will allow you to get the benefits of the record being cached, but you can also make a DNS change later on and it will only take 1 hour to be effective.

Priority: This is an option when adding an MX record. A request will try the lowest priority first, and then the next lowest and so on. Common entries are 10, 20, etc. The number is arbitrary. If the lowest priority for one zone is 1 and the lowest priority for another zone is 100, there will be no performance difference.

Now that we know what everything means, let’s look at some typical records:

Examples

You will almost always want an A record for YourDomain.com and www.YourDomain.com. Using joshprewitt-test.com as the example domain, let’s see how these records would be added.

1) Click Hosting > Cloud Servers > Any Server Name > DNS Tab > The Zone you created above
2) Click ‘Add’ to create a new Record.
3) Input the Record like this:
Type: A
Name: YourDomain.com
Content: Your IP Address goes here
TTL: 3600

For my example, this would be:
Type: A
Name: joshprewitt-test.com
Content: 184.106.219.112
TTL: 3600

You will want to add at least another record for the ‘www’ version of your domain name. This will be very similar to the one above:

Input the Record like this:
Type: A
Name: www.YourDomain.com
Content: Your IP Address goes here
TTL: 3600

For my example, this would be:
Type: A
Name: www.joshprewitt-test.com
Content: 184.106.219.112
TTL: 3600

You can think of it as when a request comes in with NAME, send it over to CONTENT.

This should get you started with setting up DNS in Cloud Servers.

Leave a comment ?

11 Comments.

  1. Thanks, it was very helpfull 😉

  2. Thanks for the write up, it was more helpful than Rackspace’s own help articles.

  3. very informative. Thanks a lot

  4. Nice write up,

    Rackspace is the shizwizzle also =)

  5. Great article! Very clear and easy to understand. I just switched over to Rackspace from managed hosting, and I am still learning my way around a web server. There is a ton of info about building a server, but very little about setting up DNS so people can actually find your site. This article was a huge help. I finally understand it now. Thanks for posting.

  6. really really very helpful! thanks man.

  7. Great Article!
    But, what’s the nameserver i should set for my domain?

  8. hello,

    fantastic articles.

    is there one about configuring email sending on rackspace?

    in particular, i am trying to set up a joomla site to send email, and have google apps enabled for sending and receiving emails.

  9. 😀 Congrats Great Article, very helpful! thanks

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">