2

We have a requirement to have multiple subdomains

- Root Domain: companyname.com 
 - Subdomains: 
    - departmentOne.companyname.com 
      - AppOne.departmentOne.companyname.com
      - AppTwo.departmentOne.companyname.com
    - departmentTwo.companyname.com 
      - AppTwo.departmentTwo.companyname.com

What is the best practice in AWS?

  • Do we just create one HostedZone? and create multiple A-Records
    • companyname.com

OR

  • Do we create multiple HostedZones one per subdomain?
    • departmentOne.companyname.com
    • departmentTwo.companyname.com
3
  • 1
    By all means try it both ways, but I suspect that only the first method would work (one Hosted Zone, multiple A-Records). This is because a Hosted Zone has an associated set of Name Servers, which would be configured against the Domain Name you have purchased. If you create multiple Hosted Zones, they would each have a different set of Name Servers and I don't see how you would be able to associated them with the domain name. (But it might work.) Let us know what you find! Mar 30, 2020 at 3:11
  • 1
    Actually both methods work. However, what is the best practice? Is there an advantage of using multiple hosted zones? You have to update the NS records of the root domain anyway, so why bother? Apr 15, 2022 at 21:34
  • @PaulMichalik the second one is better since we have the flexibility of having one aws org associated with each department. so that things are segregated and simple for department team. so both are useful depends on usecase.
    – PCB
    Apr 20, 2022 at 10:06

1 Answer 1

0

well the answer depends on the situation,

we went with both the approaches for a different reason

we had standalone and production environments

  1. for standalone we kept it simple since hostedzones cost money and everything stayed on single hosted zone default
  2. For production we did something else, the prod account is a sub-organization and the domain was in a different account we only had access to a subdomain
  3. so we created multiple hosted zones for prod and updated the NS entries into the parent AWS account.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.