I recently decided to pack together some best practices for setting up new domain names, and put it all in a short blog post
https://yuv.al/blog/setting-up-new-domains/
Curious to hear how other developers go about making decisions on where to host their domains, and how to setup DNS, a landing page and email services.
I finally broke all of this out into a Terraform module for creating the infrastructure for a static site on AWS with S3 and CloudFront: https://github.com/jdhollis/static-site
I also manage all of my other Route53 DNS records with Terraform. It’s nice to have all of that under source control (and makes it easy to replicate with a new domain).
Nice! Terraform'ing a setup like this is the only logical next step :)
Edit: BTW the TTL on your www. CNAME record is waaaay high, you can easily give it a much saner value
Why do you say that? It's only 48 hours. It's not a record that changes all that often.
Because next time you update that record, some queries will take up to 48 hours to resolve correctly. Most modern DNS services set TTLs to 3600 seconds max, and sometimes even default to 300 seconds. The performance hit is negligible.
If you're planning on changing this somewhat frequently, then yeah—it's a high TTL. But I don't really change these records all that often.
Doesn't make a difference for a low traffic site like mine either way, but higher TTLs can save on queries for high traffic sites.
Feel free to fork and add a TTL variable :)
I also use namecheap, I also use cloudflare, I also use Route53 for DNS but that's mostly because I do have aws resources to resolve to and handle routing.
Worth noting cloudflare is now providing domain registrar services, although can only transfer existing domains for now, it has the advantage to provide transparent pricing. (no usual trap with a cheap domain the first year and an extortion on renewal).
About emails, perhaps you should mention improvmx, their free tier provides unlimited MX. It forwards emails to whichever mail provider you want (e.g gmail) and also allow sending via alias.
On static hosting, not sure about netlify, I found surge.sh more straightforward. But afak neither offer SSL when using our own domain for free, so I'm still looking for a truely free static hosting provider that lets me use my own domain with SSL. (even if it only let me handle the SSL part).
Thanks for the tip about improvmx, looks great!
As for Netlify they absolutely do provide free SSL with Let's Encrypt for your custom domains.
Very good to know about Netlify. I will make a switch for my next static site I guess :)
I've personally been less than happy with Namecheap as of late and have mostly switched over to Hover.com
I've found them becoming more like GoDaddy with the constant up-sells and cross-sells as well as their web interface is pretty slow and unreliable.