2

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

  • You need to explicitly add record pointing `domain.com` to CF. Also your certificate must cover `domain.com`, not only `*.domain.com`. – Marcin Feb 06 '21 at 04:40
  • A DNS record, or a CNAME to CF? Is the DNS otherwise fine? – allthewayaround Feb 06 '21 at 04:42
  • I'm not sure what ANAME is in `Name.com`. Your CNAME in CF also should include `domain.com`. Please note that `*.domain.com` does not cover `domain.com`. So you have to explicitly use both if you want `domain.com`. This means in your DNS records, CNAMES in CF, SSL certificates, etc. – Marcin Feb 06 '21 at 04:49
  • An ANAME record is a Name.com-specific feature that automatically finds and updates A and AAAA records from the target. Unlike CNAME records, ANAMEs can be placed next to other records (one per hostname). ANAME records are commonly known as ALIAS records or CNAME flattening. – allthewayaround Feb 06 '21 at 05:12
  • 2
    I was able to use an `@` and now it works. – allthewayaround Feb 06 '21 at 05:13
  • Glad to hear that. If you don't mind I will provide an answer. – Marcin Feb 06 '21 at 05:21

1 Answers1

1

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.

Marcin
  • 215,873
  • 14
  • 235
  • 294
  • I've followed everything mentioned above. My Domain is in Google Domains and has a CNAME for www pointing to CF. CF has both www.domain.com and domain.com record. SSL certificate is for both too. I yet cannot get https colon slash slash domain.com to work. Please help. – Febian Shah Sep 23 '22 at 19:22