Joe
Joe

Reputation: 2452

Domain and subdomain setup in AWS Route 53 DNS Service

I am trying to point domain.com and sub.domain.com to the same EC2 instance's elastic ip.

Here's how my zone file looks like:

domain.com -  A record - ELASTIC_IP_ADDRESS
www.domain.com - ALIAS - domain.com
sub.domain.com - ALIAS - domain.com.

There are also SOA and NS records for the domain.com

I have tried making sub.domain.com an A record pointing to the same IP too and no luck whatsoever. DNS resolution is failing for sub.domain.com The strange thing is that resolution is not failing for the www.domain.com

As such, visiting domain.com and www.domain.com function properly but not sub.domain.com

Any idea what is going on?

Upvotes: 0

Views: 171

Answers (1)

johnml
johnml

Reputation: 428

There is more than one way to do this, but I think you want something like:

domain.com -  A record - ELASTIC_IP_ADDRESS
www.domain.com - CNAME - domain.com.
sub.domain.com - CNAME - domain.com.

CNAME records are non-alias.

Upvotes: 1

Related Questions