Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have recently set up an AWS S3 bucket for my site's static content, along w/ a CloudFront distribution for my CDN. I have this working using a sub-domain.

However, after running YSlow, I realized that cookie data is still getting passed to my subdomain CDN (4 cookies), which I suspect are cookies from the Google Adsense ads on my root domain. So I'd like to set up another dedicated root domain for my CDN.

My question is, if this new root domain is dedicated to just my CDN, what should I set up as the IP address for the root A record? Obviously, the point of a CDN is to allow it to determine the ultimate destination IP based on location.

Or, does it not even matter what this IP is, as it will be driven by the CDN anyway?

share|improve this question
    
This is one of the sticky problems that leads people to put www. back into their URLs. –  Michael Hampton Jan 23 '13 at 5:37
    
If it's truly only Google Analytics, and if you always use www. in your URLs, you should be able to limit GA to the www. domain, and cookies shouldn't be set to the cdn. domain. It's easy to overlook something in the long run, though, so it's probably better to set up a custom URL for your CDN. –  Bret Walker Jan 23 '13 at 14:44

1 Answer 1

First, you have control on the behavior of your CloudFront distribution regarding cookies. You can disable cookies forward altogether or whitelist the ones that you need.

For the DNS, you shouldn't provide an IP as the actual serving IP will be determine in run time for each user based on his location. You need to define the CNAME in your distribution settings: http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html

Note that the DNS protocol does not allow you to create a CNAME record for the top node of a DNS namespace, also known as the zone apex.

share|improve this answer
1  
I think his point about cookies is that he doesn't want the client to include them with the request, which the CF cookie forwarding/whitelisting won't affect. –  Bret Walker Jan 23 '13 at 14:31

Your Answer

 
discard

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.