Routing Traffic to an Amazon CloudFront Distribution (Public Hosted Zones Only)
If you're using CloudFront to distribute your content, you can use Amazon Route 53 to route traffic to your CloudFront distribution. The name of your Amazon Route 53 hosted zone (such as example.com) must match an alternate domain name in the CloudFront distribution. You cannot route traffic to the CloudFront domain name for your distribution (such as d111111abcdef8.cloudfront.net). The following procedure assumes that you have already registered the applicable domain names.
You can route traffic to a CloudFront distribution only for public hosted zones.
To route traffic to an Amazon CloudFront distribution
Create your CloudFront distribution, and add one or more alternate domain names (example.com, www.example.com) to the distribution. For more information, see the following topics in the Amazon CloudFront Developer Guide:
If Amazon Route 53 is not the DNS service for one or more of the alternate domain names that you added to your distribution, migrate DNS service for those domains to Amazon Route 53. For more information, see the applicable topic:
If you want to route traffic both for an alternate domain name that is the root domain (example.com) and for one or more subdomains (www.example.com, product-name.example.com) to your CloudFront distribution, you only need to create a hosted zone for the root domain.
If you want to route traffic for more than one alternate domain name that is the root domain, for example, the domain name and various misspellings of your domain name (example.com, ex-ample.com), create one hosted zone for each root domain name. You must register each domain name that you want to use.
Create one or more alias resource record sets that route traffic to your CloudFront distribution:
To route traffic for the root domain (such as example.com), create an alias resource record set for the root domain name.
To route traffic for more than one root domain (example.com, ex-ample.com), in each hosted zone that you created in step 2, create an alias resource record set that has the same name as the hosted zone.
To route traffic for subdomains (such as acme.example.com), create one alias resource record set for each subdomain.
The name of each alias resource record set must match an alternate domain name in the distribution that you want Amazon Route 53 to route traffic to.
For more information about alias resource record sets in Amazon Route 53, see Choosing Between Alias and Non-Alias Resource Record Sets. For information about creating resource record sets, see Creating Resource Record Sets by Using the Amazon Route 53 Console.