0

I just created a new site within EC2, the site works fine if I go to it's public IP.

However I am setting up this site as a subdomain for another site, e.g. subdomain.mymarketingcompany.com. The main site mymarketingcompany.com is NOT hosted with EC2.

Within (mymarketingcompany.com) domain DNS setting, I have a A record(subdomain) pointing to the EC2 public IP, the site won't load but goes the mymarketingcompany.com instead.

Any idea what's not working here?

AlanZ
  • 1
  • You're saying that within your zone settings for mymarketingcompany.com that you have an A record for a subdomain? What DNS server is this? Also, are you attempting to delegate this subdomain? – Spooler Jan 04 '17 at 23:36
  • My main site domain provider is Hover, yes, within the DNS setting I have a A record for the subdomain. The main site is hosted with Rackpace but the new site I just created is in EC2. – AlanZ Jan 04 '17 at 23:46
  • Give us the domains so we can take a look. – ceejayoz Jan 05 '17 at 00:22

2 Answers2

0

What you're describing is absolutely possible. You don't need a sub domain either. Just add an A record into the domain and set its value to the iP from Amazon ec2.

Based on the problem you're describing, it's likely the domain has a wildcard entry to point to the existing site. Otherwise, your new name would not be resolved at all. But you should be able to add a record for the name you want ands preserve existing behavior. To provide more info, we'd need to know what your domain setup looks like.

If you're not yet associating an EIP to the instance, nows the time to do it. Otherwise your iP will change when you shut down the instance or want to replace it with another.

erik258
  • 766
  • 5
  • 9
  • You're right, the main domain has a wildcard CNAME record points to mymarketingcompany.com, but the A record for the subdomain will override wildcard correct? The A record is currently pointing to the EIP. – AlanZ Jan 04 '17 at 23:48
  • What DNS provider are you using? http://serverfault.com/questions/117671/will-a-wildcard-cname-take-precedence-over-a-named-cname-record seems to suggest what you're trying to do is supported by the standards, but that doesn't mean your DNS provider complies. It's also possible you're getting an old cached answer from DNS - have you checked the TTL on the wildcard? – erik258 Jan 05 '17 at 01:39
0

Problem solved. It turns out that we have a rouge internal DNS server that caches old stuff. Clearing the caches on browser and OS won't work previously.

AlanZ
  • 1