Every once in a while I revisit a lot of the IT assets I’ve got on the go. I use GoDaddy for a lot of my domain services, and despite some challenges, it has done me well so far. One of the things that I do find limiting is the lack of a programmatic way to manage DNS for a GoDaddy domain.
They have openly stated that they want you to use the DNS manager portal that they offer, and it does work quite well. That only works if you have a human touch every time you spin up a resource though. And as you can imagine, I prefer to automate all the things!
It is worth noting that running a zone on Route53 is not free. It will cost you for the basic zone hosting as well as some cost for queries if you get a significant amount of them. There is a relatively simple Route53 cost calculator that Amazon provides here which can help give you an idea of what you can expect for the cost.
For this post, I assume that you’ve already got an AWS account. We are going to get right to the good stuff and set up our DNS domain to migrate away from GoDaddy. This could also work for whomever you host your DNS with, but obviously the instructions would vary slightly.
Creating a Route53 DNS Zone
Let’s start with a very simple switch from a basic DNS zone away from GoDaddy as my example. First, we need to go to the AWS Route53 site:
Click on the Get Started Now button, and you’ll be brought to a fresh page with a handy Create Hosted Zone button:
Now, we will be able to name our zone and select the type. You have the option of a Public Hosted Zone or a Private Hosted Zone for Amazon VPC. In this case, I will set up my zone for a public DNS zone:
As we setup the new hosted zone, you will see all of the new settings including the NS (name server) records and the SOA (Start of Authority) record:
In my GoDaddy DNS Manager for the domain I will edit my name server settings which brings up the default setup of a GoDaddy hosted configuration:
Let’s change it from Standard to Custom and add our NS record information from the Route53 environment. We can use any number of name server records, so that’s up to you. 3 or 4 is ideal because you never know when a name server could go sideways on you:
Save the changes and confirm that they look as you expect:
Now that we have that configured, we can create a new record in the zone which will let us host a server. I’ll use an A record to build the first test. Parameters are going to be default settings, and all that I’m customizing is the name and IP address. The sample will be an IPv4 address and I’m using the default Simple routing policy:
The last thing we have to do is to wait for the update to happen. Luckily, the internet DNS servers are rather rapid to update and this could take as little as a few minutes, but for complete updates around the world we should assume it could take up to 24 hours as an upper limit.
Using a simple ping command, we can see now that the record is updated:
This is a great lead in to some other posts I’ll have to show how to do the same thing programmatically by using the Route53 API. That is the real reason I began the exercise because I was looking to add some DNS registrations into a server deployment workflow which are going to be publicly registered.