This is an update to the blog I wrote on March 31 2017. Every once in a while I deploy a web application to
Google Domains and I often end up spending a good amount of time looking up documentation on how to add a custom domain 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, let's get started.
$ heroku domains:add www.your_domain.com $ heroku domains:add your_domain.com
$ heroku domains
=== your_heroku_appname Heroku Domain appname.herokuapp.com === your_heroku_appname Custom Domains Domain Name DNS Target ────────────── ──────────────────────────── www.yourdomain.com www.yourdomain.herokudns.com yourdomain.com yourdomain.herokudns.com
Custom resource recordssection and do the following
wwwin the first box
CNAMEfrom the dropdown menu
@into the last box that says
Domain Name. and click on
@in the first box that has an
@sign in it.
Afrom the drop down.
1hin the box that says
IP-Address, Domain or URL:window
DNS configure, under the
Custom resource recordsin your google domains dashboard.
mycustomdoamin.comto see if it worked.