I have read some of the AWS documents but could not find an exact answer. I am looking to have different domains resolving internally inside the same VPC.
Something like this:
domain1.internal (dns zone Z1)
domain2.internal (dns zone Z2)
Both domains would obviously resolve hosts in the same ip ranges.
Is this possible in AWS and are any potential clashes or pitfalls having this configuration?
Or should I have a single private DNS zone instead as below?
subdomain1.domain.internal
subdomain2.domain.internal
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:
A
record, which can be either Alias or non-Alias. This can be the same as the domain name of the hosted zone;CNAME
records or 'A' records for your subdomains;In your case if we take subdomain1.domain.internal
and subdomain2.domain.internal
:
domain.internal
as the parent record for the hosted zone and create 2 CNAME
or A
records for subdomain1
and subdomain2
subdomain1.domain.internal
and subdomain2.domain.internal
and use A
recordsThe 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.