0

I'm using DotEasy as a registrar for my domain (let's call it myapp.example.com) but am hosting the app's backend on AWS EC2. I want this app backend (its a web service) to have a production URL of api.myapp.example.com and a non-production/dev URL of api.dev.myapp.example.com.

Also, per AWS best practices, I have separate AWS accounts for dev and prod, so they are totally isolated from one another.

I'm comfortable leaving DotEas as my DNS as well, however if it is at all possible I'd like AWS Route 53 to be the DNS. Eventually I'll migrate onto AWS as the registrar as well.

I'm wondering what I need to do from either inside DotEasy, or AWS (either EC2 or maybe even in Route53) so that:

  • api.dev.myapp.example.com points to my EC2 instance living in my AWS "dev" account; and
  • api.myapp.example.com points to my EC2 instance living in my AWS "prod" account; and
  • If at all possible, have Route 53 be the DNS

Any ideas what the high-level flow looks like? I'm guessing its something like:

  1. Go into AWS dev account >> Route 53 and create NS/SOA records for api.uat.myapp.example.com domain name
  2. Go into DotEasy and add a DNS A record for api.uat.myapp.example.com, which is my understanding of what needs to be done to create a subdomain
  3. In DotEasy configure the api.uat.myapp.example.com record's DNS with the NS/SOA records generated on Step 1 above
  4. In the AWS dev account's Route 53 add a Traffic Policy that maps requests to my dev EC2 instance
  5. Go into AWS prod account >> Route 53 and create NS/SOA records for api.myapp.example.com
  6. Go into DotEasy and add a DNS A record for api.myapp.example.com
  7. In DotEasy configure the api.myapp.example.com record's DNS with the NS/SOA records generated on Step 5 above
  8. In the AWS prod account's Route 53 add a Traffic Policy that maps requests to my prod EC2 instance

This sounds like it should work, except I'm not sure if its possible (from a general networking standpoint, not even specifically with DotEasy) to configure two different A records (both sharing the myapp.example.com domain) with two different sets of NS/SOA records!

How is this done in real life?

1

You should be able to add any A record with your registrar for anything within your domain. It doesn't matter who's hosting the DNS, as long as it's properly configured. I'm assuming that DotEasy is still configured to be your nameserver (the SOA and NS records).

You should be able to go into the DotEasy DNS manager and add a new A record of api.dev.myapp.example.com to the IP of that box and an A record of api.myapp.example.com to the appropriate IP for this box.

Once this populates across the world's DNS servers, you should then be able to resolve the two domains to their appropriate IP's.

I'm not entirely sure how Amazon's Route 53 works, but assuming it's just a DNS server, you would need to configure the SOA and NS records in Route 53, and configure DotEasy to have the NS records point to the Amazon Route 53 servers. By doing this, you're telling the world that Amazon's Route 53 is the Start of Authority (SOA) for your domain example.com and the NS servers are the final say in the domain infrastructure for that domain. If you do this, ALL DNS entries will have to be transferred (created) in Route 53. By moving the records, DotEasy will only be the registrar of the domain name, but not the DNS host. You still pay them to renew the domain yearly.

| improve this answer | |
  • Thanks @Andrew (+1) - and yes: for now I want DotEasy to be the registrar but AWS Route 53 to be the DNS. So I think my main mental hangup is: how do I configure a single domain in DotEasy to point to two different AWS accounts (dev and prod)? Do I go into DotEasy and create a api.uat.myapp.example.com A record and associate my dev NS/SOA record with it, and then create a second api.myapp.exmaple.com A record and associate my prod NS/SOA record with it? – smeeb Mar 20 '18 at 18:42
  • 1
    You don't. You can't split your domain like that. When dealing with the SOA/NS stuff, it's all or nothing; you don't split your DNS server by sub-domain like that. I would setup example.com on your production Route 53 host and then just have an A record for each domain to point to the right box as needed. With some really fancy DNS work you probably could split the domain, but that's something that takes way more familiarity with DNS than demonstrated here. Keep in mind, an A record can point to ANY IP. DNS doesn't care if it's "prod" or "dev", it's just a record. – Andrew Mar 20 '18 at 18:56
  • Thanks @Andrew (+1) - last followup question I promise: when you say "*I would setup example.com on your production Route 53 *" do you mean: (a) migrate from DotEasy being the registrar to AWS Route 53 being the registrar? or (b) keep DotEasy as the registrar, configure DotEasy DNS servers to point to my production AWS Route 53 NS/SOA records, and then inside the production AWS Route 53 settings, create A records for each subdomain? Thanks again! – smeeb Mar 20 '18 at 19:01
  • That's up to you if you want to migrate to Route 53 to be both registrar and DNS host; I'm not entirely sure what all is offered via Route 53 so you may or may not be able to, but the registrar is just who you pay to renew/buy the name. The important part of Route 53 is the actual management of the DNS Resource Records (RR). Once you have Route 53 configured as the SOA with the NS servers pointed to Amazon, then you can configure Route 53 with all the RR's you want to be available for the world to query. – Andrew Mar 20 '18 at 19:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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