Search code examples
amazon-web-servicesdnsamazon-cloudfront

Domain Name without "www" does not work for CloudFront


I have

  1. An AWS S3 bucket as a static site
  2. A CloudFront distribution with ACM SSL certs
  3. A Name.com domain name
  4. A Heroku web app

I successfully have www.domain.com pointing to my abc123.cloudfront.net website. I also have api.domain.com successfully pointing towards my heroku app. I used ACM to generate a certificate for www.domain.com and Heroku handles its own SSL stuff as well.

That's pretty good, but just to be anal, I want domain.com to also point to my CF address. However it does not. This is how I set up my CF and DNS and wonder if anyone has any ideas. I've gone through about 20 SO questions and articles with no luck. Also Name.com URL forward does not seem to work.

DNS Settings DNS


CloudFront Settings CF Settings


Solution

  • Based on the comments.

    Currently, only www.domain.com record is used to direct connections to CloudFront (CF) distro. To direct domain.com, a new record should be created which also points to the CF distro in Name.com DNS.

    In addition to these, CNAME in CF as well as SSL certificate should also include domain.com.