Route53: how to create a subdomain blog that answers to both blog.my_site.com and www.blog.my_site.com

StackOverflow https://stackoverflow.com/questions/23280066

  •  09-07-2023
  •  | 
  •  

Question

Creating a simple CNAME in the same Hosted zone as the main domain is fine for blog.my_site.com, but it's unreachable by www.blog.my_site.com.

Here is what I did:

  1. Created a separate Hosted Zone, overdid the NS and SOA values with the ones from the main domain's Hosted Zone.
  2. Set a CNAME for www.blog.my_site.com
  3. Created an empty s3 bucket that redirects blog.my_site.com to www.blog.my_site.com

So the main reason I am creating a separate Hosted zone is that I want it to be accessible by both:

  • www.blog.my_site.com
  • blog.my_site.com

It currently doesn't work. I suspect it is because I am trying to create a new Hosted Zone with the same NS and SOA values as my main domain.

Was it helpful?

Solution

For or your use case, there is no reason to create a separate hosted zone. I would only keep the my_site.com hosted zone. Within that zone create your records, including your CNAME for www.blog.my_site.com. If it's still not working for you, it maybe helpful if you posted the domain in question.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top