• Sales: 1-800-961-2888
  • Support: 1-800-961-4454

How Can I Use CNAMES With a Cloud Files Container?


NOTE: This article is written for our first generation Cloud Control Panel. A version of this article is also available for our next generation Cloud Control Panel.

What is a CNAME?

A CNAME record is way to link your Cloud Files container to a branded URL that you display instead of a CDN URL.  For example, you might want to CNAME your CDN URL (http://c186397.r00.cf1.rackcdn.com) to a shorter or branded URL (images.mycompany.com).

 

How do I set up my CNAMEs?

You can set up your CNAME simply by managing your DNS.  Within your DNS settings, request a new record. You will need to ensure that your CNAME record points to your container CDN URL and not your object CDN URL.  If you are using DNS through Rackspace Cloud Sites, for example, it would look like this:

 

If you wish to edit or delete your CNAME, you can also do that by managing your DNS in your existing tool. 

 

Will I be charged extra for using CNAMEs?

No. 

 

Do CNAMEs work with SSL (or https) delivery?

At this time, CNAMEs will not work with SSL delivery.  While we are investigating this opportunity, there are significant challenges with this technology. 

 

Where do I find my CDN URL? 

You can find your CDN URL by clicking on your container in the Cloud Files Control Panel or by requesting your container information via our Cloud Files API.  If you are using our Control Panel, your link can be found like below.  



© 2011-2013 Rackspace US, Inc.

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License


See license specifics and DISCLAIMER

27 Comments

can I do this in my third party dns management panel i.e. hover.com? or does it have to happen within your webpanel?

Yes you can do it through hover.com

Hi

I've hosted a site in cloudfiles and enabled CDN. Now, when I set the CNAME for the container in my domain control panel, the sub-folders are not rendered, especially the image files under /images are not rendering...?

pls let me know what might be the issue..?

I'm not sure, jinishans. Are you able to access the sub-folders without using the CNAME? And can you access the root folder with the CNAME?

I've learned that subdirectories are not supported with CNAMEs at the time of this writing, but that it is a feature in the works. Hopefully we'll see it implemented before too long.

Any update of when this will be supported?

None yet, I'm afraid. When plans to make Cloud Files subdirectories compatible with CNAMEs we'll be sure and update this article.

At this time, subdirectories should be usable with cnames that point to container, given that subdirectories aren't really subdirectories (just files with names that imply the directory structure). That means a container with a cname of "example.com" could refer to a file in that container with the name "images/picture.png" with "example.com/images/picture.png".

For further examples, see our dev guide for Cloud Files:

http://docs.rackspace.com/files/api/v1/cf-devguide/content/Create_Static_Website-dle4000.html

Is there a way to get the secure URL via the Cloud Files UI? The only way I can find to do it is by using curl.

There is...sort of. You can get the regular CDN URL through the control panel, then replace the "http" with "https" in the protocol and then the "rXX" part of the domain name with "ssl". So there's some manual effort involved, but it doesn't require use of the API.

There are more details in this blog post:

http://www.rackspace.com/cloud/blog/2011/03/10/rackspace-cloud-files-cdn-launches-ssl-delivery/

What about CNAME support for the streaming URLs? I tried it and it doesn't appear to work.

You pointed the CNAME to the "c#####.r##.stream.cf#.rackcdn.com" domain for your container, correct? I'll see what I can find out, Mitchell.

I'm afraid that CNAMEs do not work with streaming at this time. I'll see about adding that to this article.

Rackspace.. come on.. why even mention this half-functioning feature? I didn't realize there was an intermittent problem with sub-directories with CNAMES until I sent an email blast to 10,000 people!

Who uses CDN containers without sub directories??

Get it together, man!

You should be able to use cnames with subdirectories at this time. Some examples can be found in our dev guide for Cloud Files:

http://docs.rackspace.com/files/api/v1/cf-devguide/content/Create_Static_Website-dle4000.html

Had a problem with my Slicehost DNS panel getting this to work. The solution was to add a trailing dot to the domain name. I was told that many panels do this automatically, but not Slicehost. Hope this saves someone some pain.

e.g., c999999.r9.cf9.rackcdn.com. not c999999.r9.cf9.rackcdn.com

I cannot use the URLs with CNAME as they are nowadays extremely long.
My DNS says there is an error:
The value and/or MX priority is/are incorrect.

So, for example, until a few weeks ago, I had an URL like this:
c14988996.r96.cf2.rackcdn.com
And now, the same URL has become this:
c771fe0e3770dd303637-f8e2ecee90cadc8d6560d9b4157a8dae.r62.cf2.rackcdn.com

The prefix goes from 9 to 53 chars & total length from 29 to 73!!

Fortunately, the "old" containers are still addressable via the old URL and CNAME, but all new containers have only this very long name.

Can you please provide a solution?

I'll see what I can find out, Diego. A standard DNS server shouldn't have a problem with a domain name of that length (and it shouldn't affect your MX records at all), but perhaps there's a limitation in your DNS management interface that balks at the longer domain name.

If it is something in their interface, you might open a support ticket letting us know who you have managing your DNS so we can investigate further and possibly work with them on a solution.

So do CNAME's really still not work? I see that there is deliver over SSL here:
http://www.rackspace.com/blog/rackspace-cloud-files-cdn-launches-ssl-delivery/

But does this work with CNAME DNS entries? If so, you should really update the article to reflect this information instead of having to find it in the comments and the wondering which is true.

CNAMEs only work with non-SSL connections at this time. If you aren't using SSL for the connection you can use CNAMEs to refer to containers.

Is it just me or did the CDN URLs get longer? I have existing CNAME records pointing to CDN URLs for containers I created over a year ago but now I happen to see that container URL has changed and gotten much longer.

Still, the existing CNAME records using the old URL is still working--what's going on? Should I be concerned?

Your current URLs should be fine. The newer URLs being generated are indeed longer, to expand the namespace we use and ensure that there are plenty of unique URLs available as our customer base grows. As I understand it the old URLs will continue to work until the container is deleted or removed from the CDN.

CNAMEs to work with SSL - we'd def benefit from this.

I suggest also adding your vote to this thread in our product feedback forum:

http://feedback.rackspace.com/forums/71021-product-feedback/suggestions/1870693-allow-override-change-of-the-ssl-certificate-on-cl

There does not appear to be a way to get the public CDN URL in your new control panel. Much of the abilities of the GEN 1 control panel do not appear in the current (GEN 2?) control panel. Will that change?

The CDN availability is actually managed at the container level, so to enable or view the public CDN URL, click on the gear menu next to the container name. From there you can either "Make public" or "View all links", depending on the container's current state with regard to the CDN.

jered, Thank you for the reply. I see that now. It is a bit jarring going from first generation panel to the new one. I did not realize those menus were going to change as you made changes in the panel.

Add new comment