Can't point my subdomain address to CloudFront distribution (using S3 + CF + Route 53)

[Jump to bottom to see updates and latest attempts]

First of all, I apologize if I misuse terminology here. I work as FE developer and this area on networking and setting up domains and aws services is really not my strongest. I took this task as a good chance for learning.

I'm hosting an application on S3 buckets. The idea is to have a bucket for analytics.gleechi.io, another one for staging-analytics.gleechi.io where I will use as staging. gleechi.io on itself has no content, so user just redirects to analytics.gleechi.io

The domain name gleechi.io was previously on a different registrar (godaddy) and I transferred it to aws.

After much struggle I was able to create hosted zones and CloudFront distributions for it and link them to my S3 buckets.

The CF works fine and if I open its link d10yu7tqracz7m.cloudfront.net my application loads correctly.

What is missing now is to point analytics.gleechi.io address to that CF. I can't figure out what am I doing wrong in here as I followed aws guides already so many times and everything seems to be in place. I have a few clues that something is wrong with DNS and perhaps it has to do with the fact that everything was registered somewhere outside aws before and I perhaps need to do something in these places?

  • I login into godaddy but I see absolutely nothing there but when I open gleechi.io it shows me a page that is clearly from godaddy.
  • Running the command dig +short gleechi.io gives me the address from 1) but running dig +short analytics.gleechi.io gives me nothing
  • To add to the confusion when I run whois gleechi.io it gives me Registrar WHOIS Server: whois.gandi.net Registrar URL: http://www.gandi.net why gandi? Shouldn't it be aws, since it is where it was transferred? Or if anything...godaddy then. Is it possible that maybe only the domain was registered in godaddy but maybe DNS was setup in gandi ? (I didn't do the setup myself, but a former employee years ago, so I might be dealing with unknown scenario here)

Here is how I setup my Route 53:

  1. I created a hosted zone analytics.gleechi.io and in there I created a record A that points to my CF d10yu7tqracz7m.cloudfront.net.
  2. I copied the 4 NS values from there
  3. I added the 4 NS values from the analytics.gleechi.io together with the already 4 existent NS values in gleechi.io
  4. Under Domains -> Registered Domains -> gleechi.io I have the 4 NS originally created by Route 53 on gleechi.io (but not the 4 from analytics.gleechi.io) , which I assume is the right way to do

Here is the aws guide I followed https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-routing-traffic-for-subdomains.html I also tried the 1st option (Create records in the hosted zone for the domain) but that didn't work out either.

Here are screenshots of the configs and values I have on Route 53

enter image description here

enter image description here

enter image description here

enter image description here

UPDATE after comments and answers:

I deleted the host zone for analytics.gleechi.io and added that as an A record under gleechi.io . Still no success Trying to lookup gleechi.io or analytics.gleechi.io on https://lookup.icann.org/lookup throws me this error: Failed to perform lookup using WHOIS service: TLD_NOT_SUPPORTED

Below screenshots of my updated configuration I'm running out of ideas here

enter image description here

enter image description here


There are two things that you have to do:

  • create an A DNS record (of type Alias) for analytics.gleechi.io and point it to the CloudFront distribution in the gleechi.io hosted zone.
  • set analytics.gleechi.io as an alternate domain for your CloudFront Distribution (Using custom URLs by adding alternate domain names (CNAMEs).

You can get rid of the secondary hosted zone you have created for analytics.gleechi.io and under Domains -> Registered Domains, leave only the 4 original name servers for the gleechi.io hosted zone.