First I purchased and registered a new domain name (ex: mynameserver.com) that I wanted my Name Servers to use. Once this was setup it will automatically create a Hosted Zone for you, but you won’t want to use that one because you will need to create the Reusable Delegation Set for this using the API. Delete the auto generated zone.
Create Reusable Delegation Set
I Used the PHP SDK to Create a Reusable Delegation Set (example) and the PHP API Documentation. When doing this you should get a response that has the NameServers that you are going to need to get IP Addresses for. To get the IP addresses, just use the linux command line and do a “dig ns-864.awsdns-44.net +short” (replace ns-864.awsdns-44.net with one of your results) to get the IP. Keep the IP addresses for all 4 of the Name Servers returned somewhere safe as we will use them after we create a new Hosted Zone.
Create Hosted Zone for Name Servers
Using the IP addresses from the step above go to the new hosted zone and add A records for each of the Name Server you want to setup.
After creating the A records, you will need to change the NS record for this domain. Edit it through the console and put in the new A records that you added in the step above.
You also need to edit the SOA record. Take the first A record you created (subdomain) and replace the first part of the record leaving (ex: ns1.mynameserver.com. awsdns-hostmaster.amazon.com. 1 7200 900 1209600 86400)
Creating a New Hosted Zone for New Domain
At this point you should pretty much have your new White Label Name Servers setup. Next step is to create a new Hosted Zone using the API and the DelegationSetId that you got from above when creating the Reusable Delegation Set. Should look like a random string of uppercase letters and numbers about 14 characters long and was in the result of the API call.
To do this you just need to use the same call as you did the first time you Created a Hosted Zone, but change out the “Name” and “CallerReference”.
“Name” is the domain
“CallerReference” is a unique ID for this request.
Once you make the API call and get the Hosted Zone setup, you just need to log into the console and change the NS records to your new ones (ns1.mynameserver.com, ns2.mynameserver.com, etc…). You will also update the SOA record like we did up above in the Reusable Delegation Set.
You will then need to create an A record in the for the new domain (example.com). This A record will use the IP of the server that you want to serve the content for your website. You will also add a CNAME record for “www” that points to your domain “example.com”.
Making Sure It’s Working
To test it all, I setup a domain on Godaddy (example.com) and changed the Name Servers to my new ones. (ns1.mynameservers.com. ns2.mynameservers.com)
Reference the following the docs from AWS Configuring White Label Name Servers