1

I have two domains; example.com and example-x.com - the former is the main domain all traffic should go to. Both domains are pointing to the same name servers and each have individual hosted zones in Route53.

I currently have example.com pointing to my Elastic IP as an A record, when then gets redirected via nginx to www.example.com.

I'm trying to configure example-x.com to point to the same Elastic IP and be routed to www.example.com.

I created two hosted zones in Route53 and set the name servers for example-x.com to be that of example.com. What am I missing? Is this even possible?

closed as off-topic by Jenny D, MadHatter, Nathan C, 84104, Scott Pack Apr 18 '15 at 14:57

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions should demonstrate reasonable business information technology management practices. Questions that relate to unsupported hardware or software platforms or unmaintained environments may not be suitable for Server Fault - see the help center." – Jenny D, MadHatter, Nathan C, 84104, Scott Pack
If this question can be reworded to fit the rules in the help center, please edit the question.

0

Each Route 53 hosted zone is going to have it's own name servers. So for each of example.com and example-x.com, you need to set the name server settings at your registrar to be the name servers displayed on each hosted zone.

set the name servers for example-x.com to be that of example.com

Most likely, the name servers will be different, so this is the wrong thing to do. Treat the name server settings for each domain independently.

Once the name servers are setup correct at your registrar, then the next thing is to create an A record in your example-x.com hosted zone for example-x.com. The value of this A record should be your Elastic IP address.

Once this is set, if you ping example-x.com, it should resolve to your elastic IP. It's irrelevant at this time if the ping actually succeeds or not. What we care about is whether we get the IP address.

At this point, it's up to your nginx and web server configuration to take over whether the redirects happen correctly.

One alternative option is to use Amazon S3 to handle your domain redirects. For example, you can create an S3 bucket named example.com. In the bucket configuration you would have it redirect to www.example.com. In your Route 53 hosted zone for example.com, you would make an ALIAS record for example.com to point to your S3 bucket.

Doing the above means you don't have to configure any of the redirects within your nginx or web server configuration: everything that reaches your actual web server is already using www.example.com.

0

If by name servers, you mean NS records, they may be different for each hosted zone. The NS records for example-x.com will be present in the hosted zone records, so you can verify.

Once you have your NS records pointing to the proper place (assuming your registrar is not AWS), it is simply a matter of setting up identical A records in each hosted zone, pointing to your Elastic IP. As long as your nginx configuration can answer for example.com and example-x.com, the redirect should work fine.

  • That's what is confusing. Both domains point to the same name servers (in the registrar settings - not AWS) and each domains' NS records are identical in Route53. – hybrid9 Apr 14 '15 at 23:31
  • That should be ok. You can just create identical A records for each domain pointing to your Elastic IP and you should be fine. Test with nslookup to make sure you get the same records returned. – Chad Smith Apr 14 '15 at 23:44
  • I had to do what @MattHouser suggested and update example-x.com name servers to point to that specific hosted zone. Then I was able to point an A record to my Elastic IP. – hybrid9 Apr 15 '15 at 15:50

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