Transfer Domain From GoDaddy to AWS Route53
I wrote this article to memorize a lesson I've learned due to my stupidity.
The store was, two weeks ago I tried to transfer my domain (pttbrain.com) registrar from GoDaddy to AWS Route53. Things turned out to be straightforward. I went to GoDaddy admin console to unlock the domain first. Then on Route53 side I just simply initialized the transfer process.
At that moment, I felt this might require some sort of record settings after the process. And everything should be fine.
Of course, I was so naive and just like this dog didn't realize he was in a fire house. One week after, I checked the site and found the domain was completely unresolvable by using DNS checker. Because I was too nervous to think, I decided to 'DELETE' the domain and wished it would come back to the domain market again.
But this domain was just gone and never came back 🤯. Luckily, AWS team thought about domain restore already and knew there were stupid people like me. After paying 66 bucks, I got my domain restored and appeared again in Route53 dashboard.
After consulting AWS technical supports and many hours online research, finally I made it work (including SSL setup).
Below is the step by step walk through
- Login to AWS and navigate to Route53
- Create a host zone profile (Be sure to config CNAME or A records)
- Copy four name servers (NS)
- Navigate to 'Registered domains' and choose your target domain
- Paste three name servers to 'Name servers' section (you can delete the original NS)
- Login to GoDaddy console and navigate to 'DNS Management'
- Add four AWS name servers to Records (Name is '@', Value is name server address)
- Using DNS checker to monitor NS propagation process
One interesting thing is you would probably see GoDaddy NS and AWS NS appear at the same time.
Since PttBrain Web App and API are hosted on Heroku,
I need CNAME www record points to my Heroku app custom endpoint, which is straightforward.
How about naked domain HTTPS redirect ? (In other words, redirect 'pttbrain.com' to 'www.pttbrain.com')
Here is how I set it up
- Create a S3 bucket and set up 'Redirect requests' to redirect to www under 'Static website hosting'
- Add certificate to AWS Certificate Manager
- Create a Cloudfront distribution and set S3 bucket endpoint as original domain name
- Navigate back to Route53
- Add a 'A' record with alias target equal to Cludfront distribution
And that's it. Hopefully this article could help someone like me in the future.