Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot connect Heroku to custom Google Domain

In Heroku, my domain name for www.[somesite].com shows an ACM Status of "OK".

I also am using automatically managed SSL.

On Google Domains, I have a CNAME for www pointing to the DNS target.

I also have a synthetic record forwarding @ for .[somesite].com to https://www.[somesite].com, with Temporary Redirect, Do not forward path, and Disable SSL.

If I use "Enable SSL" I get an error saying that:

The SSL Certificate for this domain hasn't been created yet.This process may take up to 24 hours to complete.

However, the site does not work. I do not know why Heroku shows that it does nor why it gives a ACM Status of OK.

I have been beating my head against this for several hours and have no idea what to do. Anyone have an idea?

like image 484
Yu Mad Avatar asked Jul 03 '19 00:07

Yu Mad


People also ask

How do I connect heroku to Google domains?

First open your app in the Heroku web page, then click the "Settings" button https://dashboard.heroku.com/apps/{your app name} Scroll down until you see the "Domains" section, Then click "Add domain" https://dashboard.heroku.com/apps/{your app name}/settings. Input the domain name you purchased from google (eg.

Does heroku support custom domain?

Heroku does not provide a domain registration service (for registering a custom domain name) or a DNS provider service (for hosting the DNS servers that point your custom domain name to your app).


1 Answers

Updated 2021

The following guide will help you to set up a website with SSL and forward all versions of your site to the appropriately secured site (https).

  1. (Heroku) Deploy the site on Heroku (either with CLI or Github integration)

  2. (Heroku) Upgrade to the "Hobby" Dyno (for $7).

  3. (Heroku) Add SSL by going to Settings -> Configure SSL. Choose "Automatically".

  4. (Heroku) Add a domain (on heroku.com) by clicking "Add domain". Be sure to use www in the domain name. So the Domain Name text field would be "www.example.com".

  5. (Google Domains) Add a Custom Resource Record

  • Name: www
  • Type: CNAME
  • TTL: 600
  • Data: URL from Heroku
    • For example, behavior-apple-eh2cfqgjkiop23q1wvd4372b.herokudns.com.
  1. (Google Domains) Add a Synthetic Record
  • Subdomaine Forward
  • Subdomain: @
  • Destination URL: https://www.example.com
  • Permanent Redirect (301)
  • Forward path
  • Enable SSL
  1. (Google Domains) If you are using a domain that requires DNSSEC (such as a .dev domain), enable DNSSEC in the DNSSEC section.

You will have to wait about 15 minutes for everything to propagate. At the conclusion of the 15 minutes, you will be able to go to every combination of your site, and it will redirect to https://www.example.com.


Some of the errors you may see along the way are as follows:

ACM Issue

On Heroku:

ACM is failing for 1 domain name

www.example.com Unable to resolve DNS for www.exampe.com

ACM error

Solution: the reason you are seeing this is because your CNAME is not set up on Google Domains. Complete step (5) above to resolve this issue.

Extra Period Issue

(On Google Domains) "A period keeps getting added to the end of the "Data" section of the URL when I put it in."

Solution: This is expected.


Helpful images

Final Heroku Page

enter image description here

Final Google Domains Page

enter image description here


Resources

  • Other StackOverflow answer
  • My root domain isn’t working, what’s wrong?
  • Heroku Devcenter: Add a Custom Root Domain
like image 130
Shane Fontaine Avatar answered Sep 30 '22 04:09

Shane Fontaine