Background: I’ve recently started working on a web application where the domain was purchased through GoDaddy. Personally, I use Name.com, they’ve always had the functionality I needed and their interface is nice to look at. This post is about overcoming a specific challenge I had with GoDaddy so I could avoid using their DNS.
Scenario: With this web application, I’m currently building out our infrastructure to run web servers in multiple places (future blog posts will elaborate on that). To facilitate this, I’m testing out Route 53’s Latency-based routing which allows you to have one domain name that routes requests to the servers with the lowest latency. Very simply this means that requests from the UK go to Amazon’s EU-Ireland, requests from the US go to Amazon’s US-East data center.
In order to test that out though, I needed to start by testing out a subdomain. I couldn’t just use a new domain because I needed our SSL certificate. Turns out this isn’t very well documented and GoDaddy claims this isn’t even possible with their service, but its not only possible but pretty straightforward.
Let’s head over to your Amazon account. I’m going to assume you’re already using AWS, so I’ll skip the intro to that. Under Compute & Networking, click Route 53.
Click Create Hosted Zone. Here you will enter the subdomain you want to use. Our example uses subdomain.yourdomain.com.
Once created, you will be presented with the following screen. If not, just click on the subdomain from the list on the right. Take note of the delegation set, that’s what we’ll be using in the following steps with GoDaddy.
Head over to GoDaddy and login. Click My Account -> Domains and open the Domain Details for the domain of the subdomain you want to redirect. You should see three tabs, click on the DNS Zone File tab.
Click the Edit button. You’ll get popped over to the page where you can actually edit the DNS Zone File. Scroll to the very bottom and you should see the NS (Nameserver) section, which is what you want.
You will need to do the following for each of the records you got from Route 53, the four URLs under Delegation set.
Click Quick Add and enter the subdomain under Host and the DNS URL under Points To. You should add a total of four records.
Once you’ve added each of the DNS records from the Delegation Set, just save your records in the DNS Zone File and within an hour or so your subdomain should be propagated and sending requests through Route53.
Now head back over to Route 53 so we can actually send your requests somewhere. Another blog post will cover setting up latency based routing, but let’s just point it to a load balancer for now via an alias.
In Route 53, click the hosted zone you created.
Click Create Record Set. Switch Alias to Yes, and from the target list select the AWS Resource you want to point it to. The name field appears to be optional, but feel free to use it.
If you have an Elastic IP you’d like to use instead, don’t use Alias and add the IP address to the record set list.
And that’s it! You should now have a subdomain routed by Route53. More posts to come on the things you can do with the open-ended configurability options you gain with Route53.