Ken Yip
Ken Yip

Reputation: 761

How can I set the root domain as CNAME record with cloudfront?

I would like to point my root domain (abc.example) into cloudfront CNAME record (xxx.cloudfront.net). However, CNAME with @ as Host is not allowed at GoDaddy.

godaddy Setting

I wish https://abc.example is able to point to xxx.cloudfront.net.

How can I make the change?

Upvotes: 4

Views: 8759

Answers (2)

John Rotenstein
John Rotenstein

Reputation: 269091

You can redirect your own custom domain name to Amazon CloudFront but you will need to use Amazon Route 53 instead of a third-party DNS service.

From Routing Traffic to an Amazon CloudFront Web Distribution by Using Your Domain Name - Amazon Route 53:

If you want to use your own domain name, use Amazon Route 53 to create an alias record that points to your CloudFront distribution. An alias record is a Route 53 extension to DNS. It's similar to a CNAME record, but you can create an alias record both for the root domain, such as example.com, and for subdomains, such as www.example.com. (You can create CNAME records only for subdomains.) When Route 53 receives a DNS query that matches the name and type of an alias record, Route 53 responds with the domain name that is associated with your distribution.

The steps are:

  • Use an A Record in Amazon Route 53
  • Set Alias = Yes
  • Set the Alias Target to the CloudFront distribution

Please note that additional steps are required if you wish to use HTTPS (SSL) for the distribution. Using SNI is free, but dedicated IP addresses are expensive. See: Custom SSL | Content Delivery Network (CDN), Domain Registration | Amazon CloudFront

Upvotes: 7

Domingo Pichardo
Domingo Pichardo

Reputation: 15

Unfortunately that is not possible. This is a DNS limitation because CNAME does not allow you to have the same record more than once in the zone, regardless of record type. Therefore, the SOA and NS records would conflict with it, as well as MX record if present.

Upvotes: 1

Related Questions