Custom Subdomain for Ghost Blog
January 05, 2020
I figured that I would write this as my first post since I just went through the process of setting up a new blog through Ghost, and didn’t find too many specific resources to help get the custom domain configured. I had already been using AWS Route53 as my DNS service for my hackerrdave.com domain, so the plan was to configure the new blog to be available at blog.hackerrdave.com. The original domain for the blog that Ghost created for me out of the box was https://davidkerr.ghost.io, so I needed to configure my DNS service to forward traffic to that domain.
DNS is a globally distributed service that translates human-readable names like example.com into numeric IP addresses (think: a phone book) The solution was to add a CNAME record to my existing hackerrdave.com hosted zone.
AWS defines a hosted zone as:
A hosted zone tells Route53 how to respond to DNS queries for a domain such as example.com
A CNAME record (short for Canonical Name) maps one domain name to another name (think: an alias). So for my scenario what I needed to do was add a CNAME record that mapped:
blog.hackerdave.com -> davidkerr.ghost.io -> [ghost blog IP Address]
Adding this record is pretty straightforward in Route53, and you’ll just need to fill in the Value field with the ghost domain.
Once the record set was saved, the DNS mapping was complete. Over on the Ghost side of things, I needed to enter the admin settings at my.ghost.org to let the Ghost servers know where traffic would be coming from, and so they could generate the certificates with the correct associated domain. Once that step was complete, the subdomain was ready for use.