Note: Please go to docs.rightscale.com to access the current RightScale documentation set. Also, feel free to Chat with us!
Home > Library > 3rd Parties > DNS > Cloud DNS > Domain Setup with Rackspace Cloud DNS

Domain Setup with Rackspace Cloud DNS

Objective

To set up DNS hostnames for a deployment's load balancing and database tiers using Rackspace's Cloud DNS service. 

Table of Contents

Overview

Rackspace's Cloud DNS (http://www.rackspace.com/cloud/cloud..._products/dns/) service is a supported DNS Provider that offers dynamic DNS services. It's a free API service designed to help you easily manage domains, sub-domains & DNS records for your Rackspace cloud servers.

Prerequisites

  • An existing Rackspace account
  • A running Rackspace cloud server
  • Use of RightScale's Chef-based ServerTemplates to launch the database servers. (The use of Cloud DNS with 11H1 ServerTemplates is not supported.)

Steps

Create a New Account

If you have an existing Rackspace account, you can automatically use their Cloud DNS service. 

Log into the Rackspace Cloud Console

Log into your Rackspace account. (https://manage.rackspacecloud.com/pages/Login.jsp)

Create DNS A Records

The next step is to create DNS hostnames for your cloud servers.  You'll need to create DNS Hostnames for both your frontend / load balancing tier, as well as your database tier.  

Database Tier

diag-3tier_ga-CloudDNS-v1.png

 

  1. Go to the DNS tab.
  2. If a domain has not been created, you must create one. Click the Create Domain button and enter a domain name (e.g. example.com), contact email address and the default TTL for the DNS records. For database servers, it's strongly recommended that you use the default TTL (5 minutes). 
    Note: You will be able to specify a different TTL when you create each DNS record. 
    screen_Create_Domain_v1.png
  3. Update the name servers with your domain registrar (i.e. the company with whom you registered the domain) for your domain that you want to manage with Cloud DNS. Change the DNS name server settings to point to Rackspace's Name Servers instead. Note: It typically takes 1-2 days before the domain name server changes are applied globally. You may need to wait a few days to test your DNS records from your location. 
    screen_DNS-Name-Servers_v1.png
  4. The next step is to add a record. Click Add Record and provide the required information. First, create the A record that will point to the "master" database server. If you are using the records for a database server, use the lowest allowable TTL for Cloud DNS, which is 5 minutes (300 seconds). 
    screen_CloudDNS-A-Record_v2.png
  • Record Type - Select 'A/AAAA Record' as the DNS record type.
  • Record Name - Enter a unique subdomain to create a hostname for your domain. (e.g. master-db.example.com)
  • IP Address - Enter a valid IP Address. (e.g. 1.2.3.4) This IP Address serves as a placeholder since you will not know the private IP address that the Master-DB server will be assigned when it is launched. Later, when you set up your database servers, a script will be run that will update the DNS record with the instance's private IP address. 
  • Time To Live (TTL) - Use the minimum TTL that is allowed by Cloud DNS, which is 5 minutes (300 seconds).
  1. Click Add Record to save the create the A record. Note: You may need to refresh the web page in the browser in order to see the new record.
  2. Repeat steps 5-6 to create additional DNS records. Examples below.
    • master-db.example.com  - Points to the "master" database server.
    • slave-db.example.com (optional) - Points to a "slave" database server.
    • www.example.com - Points to one of the load balancer servers. Once the load balancer server is operational, you will need to manually update the record with the appropriate public IP address. Create additional records for other load balancer servers. If you are using a load balancing service like Rackspace Cloud Load Balancers, you will only need to create one record that points to the CLB's public IP address.

Retrieve DNS Record IDs

In order to update the DNS A Records with an IP address, you must specify the record's unique ID as an input. Currently, you cannot retrieve the ID from Rackspace Cloud Console. However, you can follow the steps outlined below to retrieve the information. 

The easiest way to retrieve the record ID is by executing a Rackspace API call. However, before you can execute an API call, you must first generate an API token for authentication purposes.

  1. Create a new RightScript (e.g. Generate a Rackspace API Authentication Token) that will generate an API token.  For Rackspace US, use the following code:
    • curl -D - -H "X-Auth-Key: $RACKSPACE_AUTH_KEY" -H "X-Auth-User: $RACKSPACE_USERNAME" https://auth.api.rackspacecloud.com/v1.0
      
  2. Run the above script on a running server using the 'Any Script' option. You will need to pass your Rackspace cloud credentials as inputs in order to run the script. For example:
    • RACKSPACE_AUTH_KEY - cred: RACKSPACE_AUTH_KEY
    • RACKSPACE_USERNAME - cred: RACKSPACE_USERNAME
  3. After the script is completed, go to the server's Audit Entry tab. After the script is complete, view the audit entry and find the authentication token ("X-Auth-Token"):
    screen_Generate_Token_v2.png
  4. (Recommended) Create the following credentials, which you'll use to run the next script. (Design > Credentials)
    • RACKSPACE_ACCOUNT_NUMBER - To retrieve this information, log into the Rackspace Cloud Console. The account number should appear next to the username at the top of the page.
    • RACKSPACE_API_TOKEN - The Rackspace API Token that you just generated with the previous script.
    • RACKSPACE_DOMAIN_ID - Rackspace Domain ID. To retrieve this information, log into the Rackspace Cloud Console and go to DNS and select the domain. The ID is the last number in the URL. For example, if the URL is https://mycloud.rackspace.com/a/username/dns#rax%3Adns%2CcloudDNS/3514324, 3514324 is the Domain ID.
  5. Create another RightScript (e.g. Retrieve DNS ID for Rackspace Cloud DNS) with the following code:
    • curl -X GET -H "X-Auth-Token:$RACKSPACE_API_TOKEN" -H "Accept:application/xml" https://dns.api.rackspacecloud.com/v1.0/$RACKSPACE_ACCOUNT_NUMBER/domains/$RACKSPACE_DOMAIN_ID
      
  6. Run the above script on a running server using the 'Any Script' option. Use the created credentials (if available) or use the 'text' option to pass the appropriate values for the required inputs.
  7. Once the script is complete, go to the audit entry and find the unique ID for each DNS Record. (e.g. A-1234567)  Later, you will set this value as an input so that you can run a script that will update the DNS record with the database server's IP address. You will find a DNS Record ID for each A record associated with your domain. If you created multiple A records (e.g. master and slave), make sure that you select the appropriate ID for the matching FQDN.
    screen_Audit-RecordID_v1.png

Load Balancing Tier

Although you can use Cloud DNS to create A records for load balancing purposes, it's not required. For example, you may use a load balancing service like Rackspace's Cloud Load Balancers or use a different DNS provider to create DNS records for your dedicated load balancer servers.

If you are using ServerTemplates to launch dedicated cloud servers for load balancing purposes, you can create A records for each load balancer in Cloud DNS. It will be easiest to create A records that point to the load balancers once they are operational.

If you are using Rackspace Cloud Load Balancers, go to the CLB's details page to find its public IP address. Create a single DNS A record that points to the IP.

screen-CLB_Public_IP-v1.png

Input Name Matrix

When you configure the deployment's inputs, specify the following information so that the scripts will be able to update the DNS hostnames inside Cloud DNS.

Note: Cloud DNS is not a supported DNS provider for the RightScript-based (11H1) or Chef-based ServerTemplates.

Input Name - v12, v13 (Chef) Example Value

DNS Service Provider

text:  CloudDNS

DNS Password

cred: RACKSPACE_AUTH_KEY

(Password to access the Rackspace account)

DNS User

cred:  RACKSPACE_USERNAME

(Username to access the Rackspace account)

Database Master FQDN

text:  db-master.example.com

(Hostname for the Master-DB server)

Database Master DNS Record ID

Syntax: <DOMAIN_ID>:<RECORD_ID>

text:  3456789:A-1234567

Database Slave DNS Record ID (Optional)

Syntax: <DOMAIN_ID>:<RECORD_ID>

text:  3456789:A-2223334

You must to post a comment.
Last modified
09:31, 5 Nov 2013

Tags

This page has no custom tags.

Classifications

This page has no classifications.

Announcements

None


© 2006-2014 RightScale, Inc. All rights reserved.
RightScale is a registered trademark of RightScale, Inc. All other products and services may be trademarks or servicemarks of their respective owners.