Jump to content

Linking a domain to Heroku

Recommended Posts

Hi! I used to use google domains. I'm currently not having success linking a domain to Heroku.

Heroku allows you to enter a DNS, for example: "www.mywebsite.com". Heroku then provides a DNS target that looks like this: "some-letters.herokudns.com".

In Google domains, to make it work, you then do the following:

  • Create a DNA record. Name: "www.mywebsite.com" Type: "CNAME", Data: "some-letters.herokudns.com." Note the appended period at the end.

Then you set up Domain forwarding of "mywebsite.com" to "www.mywebsite.com", as type 302, Forward path, for both A, and AAAA.

I've tried doing this in SquareSpace, and get various error messages when viewing the site based on which combination of options I choose. WWW on the main page? Extra dot on the DNS target etc. Any ideas? Thank you!

 

ss.png

SS2.png

Edited by the_alchemist
Link to comment

Squarespace automatically adds your root domain to the end of the Host value when creating DNS records. In the Custom Records section, try using the following Host values:

Host: @
Type: A
Data: [redacted]

Host: @
Type: AAAA
Data: [redacted]

Host: www
Type: CNAME
Data: [redacted]

It's also important to note that if you're adding a forward rule for the "www" subdomain, you won't be able to add the "www" CNAME record in the Custom Records section because they will conflict with each other. Essentially, you can't forward/point a subdomain to two different URLs.

Based on the information in Heroku's guide, I don't think you need the forwarding rule:

https://devcenter.heroku.com/articles/custom-domains

Link to comment
  • 2 months later...
On 3/11/2024 at 6:16 PM, the_alchemist said:

Thank you very much! That solved it entirely: Setting CNAME 'Host' = 'WWW'.

Interesting, I tried this and I get a "CDN not returning HTTP challenge" error message on Heroku. Any ideas?

Link to comment
On 3/10/2024 at 4:42 AM, PixelSoda said:

Squarespace automatically adds your root domain to the end of the Host value when creating DNS records. In the Custom Records section, try using the following Host values:

Host: @
Type: A
Data: [redacted]

Host: @
Type: AAAA
Data: [redacted]

Host: www
Type: CNAME
Data: [redacted]

It's also important to note that if you're adding a forward rule for the "www" subdomain, you won't be able to add the "www" CNAME record in the Custom Records section because they will conflict with each other. Essentially, you can't forward/point a subdomain to two different URLs.

Based on the information in Heroku's guide, I don't think you need the forwarding rule:

https://devcenter.heroku.com/articles/custom-domains

A and AAAA records are not possible with Heroku as I understand, since there are no static IP addresses and Squarespace only allows static IP addresses.

Link to comment

It's true that Squarespace doesn't support dynamic DNS. It looks like there are some Heroku add-ons you can use to route traffic through a static IP, like QuotaGuard Static.

I'm not 100% familiar with Heroku, but it seems to me that this is specific to connecting a root domain. Squarespace did recently add support for ALIAS records, and Heroku's guide mentions using ALIAS records for other providers:

Heroku - Configuring DNS for root domains

Their guide also mentions getting around this issue by exclusively using subdomains, like the "www" subdomain:

Heroku - The Limitations of DNS A-Records

Heroku - Add a custom domain with a subdomain

Hopefully some of this is helpful! It's certainly worth double-checking with Heroku support since I'm not entirely sure if this is all accurate.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.