Today I deployed a couple of web applications to Heroku and used Google Domains as my domain host. Every once in a while I have to do this and I often end up spending a good amount of time looking up documentation on how to add custom domains to Heroku. To save time for next time, I’ve compiled this blog for me and other Rails developers who might find themselves in a similar situation. This blog assumes you have a Ruby on Rails application already deployed to Heroku and a domain name hosted at Google Domains. If you need help deploying your app to Heroku, I would recommend the fantastic Ruby on Rails Tutorial by Michael Hartl. Otherwise, lets get started.
Add your domain using the command below in your terminal
$ heroku domains:add www.your_domain.com
Retrieve your DNS Target which you’ll need for Google Domains by running the code below in your terminal.