2

[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

2 Answers2

2

There are two things that you have to do:

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.

Nick
  • 361
  • 1
  • 4
0

your hosted zone should have only 4 DNS records. You have 8, which will cause the DNS to function incorrectly. What you have to do is to create hosted zone only for the main domain gleechi.io. Then you can create the DNS records (Alias A records or CNAME records) for the two subdomains analytics and staging-analytics in the same hosted zone itself.

  • It has 8, because the other 4 are from the subdomain as described in the 2nd method here https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-routing-traffic-for-subdomains.html . I tried your solution before (1st method in the link) and that did not work out – Rafael Santos Sep 28 '21 at 14:45
  • The documentation was not understood correctly. See point no.4. When hosted zone for subdomain is created, the main domain has to be told about it and hence separate nameservers should be specified. The solution specified will work above for sure. But since you misconfigured the DNS zones, it will not work. So get rid of the current hosted zones. only 4 unique NS records should be shown for the main domain. Then the above solution will start working automatically. Also did you specify the subdomain as the Alternate domain name in the cloudfront settings? – Ravi Kumar CH Sep 28 '21 at 15:46
  • Im sorry, I'm still confused about "When hosted zone for subdomain is created, the main domain has to be told about it and hence separate nameservers should be specified." . That is exactly why the 8 NS on the main domain. Originally it had just 4. Once I created the hosted zone for subdomain, then I added these 4 from the subdomain to the main domain. What am I missing here? I'll try your solution for sure later, but I still need to be able to understand because I believe you, likely it's me misreading the guide somewhere – Rafael Santos Sep 28 '21 at 15:59
  • if the separate hosted zone for analytics.gleechi.io is created, then the nameservers should be specified for analytics.gleechi.io in the main domain's DNS records. But you have specified them for gleechi.io. This is the misinterpretation of the documentation i was referring to. – Ravi Kumar CH Sep 28 '21 at 16:05
  • no, I have specified for both. Each one contains 4. But anyway, I updated my question with the other approach still no success :( – Rafael Santos Sep 28 '21 at 17:33
  • yes, you need to wait before DNS propogates. – Ravi Kumar CH Sep 29 '21 at 05:15
  • it worked. You are a legend Sir! – Rafael Santos Sep 29 '21 at 11:51