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.
- 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.
$ heroku domains
- You should see somethings like the code below.
=== your_heroku_appname Heroku Domain
- Next log into your Google Domains account
- Click on
- Find the
Custom resource recordssection and do the following
wwwin the first box
CNAMEfrom the dropdown menu
- Type in the
@into the last box that says
Domain Name. and click on
- Next, in a new raw, type in
@in the first box that has an
@sign in it.
Afrom the drop down.
1hin the box that says
- Next we want to get the IP address of our domain name so lets do the following:
- Visit This Website
- Type your url
IP-Address, Domain or URL:window
- Copy the IP address you receive
- Go back to your Google Domains Dashboard
- Paste the IP address into the last box that says
DNS configure, under the
Custom resource recordsin your google domains dashboard.
- Next click on
- Check after 30 or so minutes, by visiting your url e.g
mycustomdoamin.comto see if it worked.
- To see how your website appears to the rest of the world while you wait for the settings to take full effect visit GeoPeeker and enter your domain name in the search box.