http://www

Setting Up A Custom Domain For Your Heroku-Hosted App

Ethan Ryan
4 min readMar 19, 2018

In my free time, I’ve been slowly but steadily building out my story generator app, which is hosted on Heroku here:

https://word-nerds-client.herokuapp.com/

I’m proud of it, and I have a long to-do list of things I want to improve.

One of those improvements is replacing that long Heroku domain name with a custom domain name I bought through name.com:

www.wordnerds.co

Step 1

First things first: follow Heroku’s Custom Domain Names for Apps directions:

Step 1

I followed Heroku’s instructions by running in the command line:

heroku domains:add www.wordnerds.co

Terminal told me I had “Multiple apps in git remotes”, so I ran the command again, this time specifying my remote production app:

Step 1 continued

Sweet. The next step was configuring my app’s DNS provider to point the DNS Target.

Step 2

OK. Now I had to configure the DNS provider.

But first I ran wait because I saw them do that in the instructions, and I already took a screenshot so why waste a nice screenshot if I’m not gonna put it in my blog post?

Wait for it, wait for it… done.

Cool. OK, now let’s take care of bizness.

According to Heroku’s instructions:

After using the domains:add command you must point your DNS provider at the domain’s DNS Target supplied by Heroku. See above for viewing domains to find the DNS Target. This usually takes the form of configuring a new CNAME record with your DNS provider as shown in the table below. Consult with your DNS provider for specific instructions to create CNAME records.

Right.

I already had a little placeholder txt file for my wordnerds.co domain. Here’s how that looked:

Word Nerds dot co

Apologies if the above misspelled curse word has offended your sensitive sensibilities.

On name.com I deleted my nameservers and reset them to the default name.com nameservers.

Then for the DNS records, I used type CNAME, entered my custom domain name as the NAME (called HOST on name.com), and entered www.wordnerds.co.herokudns.com as my TARGET (called ANSWER on name.com).

Step 2

Step 3

Last step: I thought I messed up somehow.

As the Heroku instructions say: “DNS changes can take several minutes to several days to take effect.”

I kept checking wordnerds.co in the browser and I kept showing me the same thing:

saddness

Finally, I had the bright idea to through www before my domain name.

success!

Success! Oh man, so much better to see my Heroku-hosted app showing up under my custom domain name.

To get the root domain, AKA wordnerds.co without the www before it, I added a ANAME record, left the NAME/HOST field empty, and entered the TARGET/ANSWER per Heroku’s instructions for configuring DNS for root domains.

Here’s how that all looks on name.com:

my wordnerds DNS records on name.com

I’m waiting for that to propagate, but hopefully that’ll work too.

EDIT: I wrote the above sentence on Sunday at 7:30pm, by 8pm the root domain was working as well.

Looking good, Word Nerds!

--

--