Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have set up an Edgecast CDN to mirror all my static content. Because I use the root of my domain ( to host my main site—using Google Analytics which sets cookies—I've stored the corresponding static files in a separate cookieless domain ( which is used only for this purpose. I've set it up (using this guide for general guidance), with the following structure, based on a combination of customer origin and CDN origin to make the most of the chosen short domain name and provide meaningful URLs:

  1. is set as the customer origin for the content stored in the CDN at directory;

  2. I've then set up various subdomains of a separate domain, the conveniently-named, as CDN-origin Edge CNAMEs for each of the corresponding static content types:

    • points to the origin directory;
    • points to the origin directory;
    • points to the origin directory

and so on. This results in some pretty nice, short, clear URLs.

The DNS zone file for (yes, it's a real domain name registered in Djibouti) is set properly:          43200   IN   A      43200   IN   CNAME   43200   IN   CNAME       43200   IN   CNAME

The DNS resolves to the Edgecast URL:

$ host is an alias for is an alias for has address

But whenever I try to fetch a file in any of the directories to which the CNAME assets map, I get a 404:

$ curl
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="" xml:lang="en" lang="en">
        <title>404 - Not Found</title>
        <h1>404 - Not Found</h1>

despite the fact that the corresponding customer origin file exists:

$ curl

fetches the content of the combined.js file. Yet it's been more than enough time for the DNS to propagate since I set up the CDN.

There's obviously some glaring mistake in the above-described setup, and I'm a bit of a novice with CDNs—but any suggestions would be gratefully received.

share|improve this question
up vote 3 down vote accepted

It doesn't have anything to do with DNS. You shouldn't be using CDN origin servers. All your content is on your customer origin server. With CDN origin servers you manually (via FTP) upload content to it.

So, delete the CDN origin servers. Delete the A record (assuming you just want to use for cdn)

Then follow these instructions from

To configure our edge servers to recognize your CNAME

  1. Navigate to the Edge Cnames page, which can be found on the HTTP Small Object tab of the MCC.
  2. In the New Edge Cname option, type the name of the desired CNAME record. The CNAME should be specified in lower-case letters and should not include the protocol (i.e. http://). [ For example -MAW ]
  3. Select whether the specified CNAME will point to a customer origin or CDN origin server. [ In your case customer origin. -MAW ]
  4. By the Points to option, select the root location on the origin server to which the CNAME will be pointed. If you would like to indicate a specific folder, then you should type a forward slash (/) followed by the path to the desired folder. [ For examample: for -MAW ]
  5. Click Add.
  6. Make sure that a CNAME record that points to the same domain has been registered on your DNS server. This CNAME record must match the name assigned to your edge CNAME. [ You've already done this. -MAW ]

Then this is what happens:

  1. A web browser makes a request for
  2. The CNAME sends the request to
  3. looks at the HTTP host header and sees
  4. looks through its config and finds a masking URL for with customer origin server
  5. acts as though it just got a request for the URL
  6. combined.js is served from the cache or retrieved from and then served.
share|improve this answer
Thanks for that suggestion. It occurred to me on reading your answer that I could achieve the same result more simply by storing the static content on, instead of (since, as you correctly assumed, I wasn't planning to use the root domain of That way I can free up for another use, and keep the static content within the same domain. Then I added all the subdomains as customer origins with the relevant directory appended. Now we just need to see whether that works once it's propagated. – Donald Jenkins Mar 3 '12 at 7:13
It's working—now that it's propagated—when set up as mentioned in my last comment, taking account of your suggestion, and moving the static content to Thanks. – Donald Jenkins Mar 3 '12 at 7:46

This is because you haven't configured your DNS correctly.

It seems you have DNS wildcard enabled, so that will be an A record to

Your css, js, images subdomains also seem to point to this IP instead of being CNAMES; This leads me to believe you have incorrectly configured these.

To configure the images subdomains you should have something like:

images.cdn 43200 IN CNAME

I really hope you say * as a way to shorten, as is not a real domain you can use.

share|improve this answer is a real domain. It's hosted in the Republic of Djibouti and I'm its proud owner. I see your point about the wild card, and I've removed it, but I actually have a CDN set up from in the same Edgecast account, which worked without issues despite the fact has the same wild card in its DNS – Donald Jenkins Mar 2 '12 at 20:15
You're right, my bad; It seems that my answer is not valid, as for, you do have DNS configured correctly, based on the info you've provided. I think you'll need to get in touch with Edgecast to further diagnose the issue, as it seems… does not work either, so this is likely a problem on their end. – gekkz Mar 2 '12 at 20:21
Yeah, thanks. I send them an email linking to this post as it seemed easier to do that than explain over the phone, but haven't heard back yet. Thanks for responding—hope you understand why I really wanted for my cdn! – Donald Jenkins Mar 2 '12 at 20:24
I do indeed, and I don't think I've seen a dj domain before. – gekkz Mar 2 '12 at 20:27
Haha! I use via.djas my URL shortener: it's mapped to a bitly Pro account, also via a CNAME, and works out of the box without problems. – Donald Jenkins Mar 2 '12 at 20:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.