By default AWS uses Route 53 for domain resolution. Route 53 provides Private Hosted Zones for internal domains. Private Hosted Zones are tied to VPCs, so they they will resolve domains in the same CIDR ranges.
When you create a Private Hosted Zone, you specify a parent domain. Each hosted zone can have different type of records. NS records are generated by AWS, you don't have to create them manually. In case of other records:
- You can have an
A
record, which can be either Alias or non-Alias. This can be the same as the domain name of the hosted zone;
- You can multiple
CNAME
records or 'A' records for your subdomains;
- You can have other records, for other purposes (see record types )
In your case if we take subdomain1.domain.internal
and subdomain2.domain.internal
:
- You can have
domain.internal
as the parent record for the hosted zone and create 2 CNAME
or A
records for subdomain1
and subdomain2
- Or you can create separate hosted zones for
subdomain1.domain.internal
and subdomain2.domain.internal
and use A
records
The downfall of the first approach is that your hosted zones wont be as granular, meaning that everything which ends with domain.internal
will be resolved with this hosted zone. You can override this, by creating other hosted zones with more precise parent domain names (see overlapping namespaces).
The downfall of the second approach is that you will pay for each hosted zone. Private Hosted Zones are relatively cheap.