37

This functionality is required for properly directing a root domain to Heroku:

https://devcenter.heroku.com/articles/custom-domains#cname-functionality-at-the-apex

Some registrars, like DNSimple, support it. Is it supported by the new Google Domains?

alpheus
  • 515
  • 1
  • 4
  • 6
  • 3
    It's recommended that you redirect to www instead of trying to serve a site at the naked domain name. – Michael Hampton Aug 01 '14 at 16:12
  • 4
    I know, but like many other people I have sites that have been operating for a long time without the "www" and need to continue to do so. – alpheus Aug 01 '14 at 16:28
  • It's [not usually that difficult to switch back](http://serverfault.com/q/451348/126632). Don't let "SEO" concerns stop you. – Michael Hampton Aug 15 '15 at 06:31

4 Answers4

28

No, but you can have Google Domains forward your root domain to your www CNAME.

First create a CNAME in the Custom Records section pointing www to yourapp.herokuapp.com.

Then in the Synthetic Records section, choose Subdomain forward, enter @ in the subdomain field and www.yourdomain.com in the Destination URL field.

Save those and you're done.

Travis Reeder
  • 451
  • 4
  • 5
  • 1
    This is not a great way to go because it will not "forward" an arbitrary URL path, it will only send you to the root www if you type any @ url. – tommybananas May 30 '16 at 18:50
  • 5
    This solution worked for my redirection of the apex domain. Google domains lets you specify whether to forward the path or not in the item setup, and the path is forwarding correctly for me. It does not handle https well,but we don't have a use for this yet, so not a problem. – Miro Aug 22 '16 at 16:46
  • 4
    @tommybananas -- Google Domains seems to allow for forwarding of path now. – BadPirate Nov 08 '16 at 20:53
  • 5
    They have also added https forwarding – maxm Oct 29 '18 at 22:47
27

No.

The full list of records supported by Google Domains can be found at:

https://support.google.com/domains/answer/3290350

There is no 'ALIAS' or 'ANAME' or any other similar pseudo-CNAME supported.

Please note that the type of record mentioned by the Heroku documentation is not an actual CNAME, but rather an A record that is auto-updated to match some arbitrary external A record. Amazon Route 53, as well as several other DNS providers offer this, and call it various things - some call it ALIAS or ANAME etc - but it is not an actual RR type.

Google domains does support a thing called "synthetic records", however AFAIK it would not help you with Heroku.

https://support.google.com/domains/answer/6069273

Joe Sniderman
  • 2,749
  • 1
  • 21
  • 26
  • 12
    This is a real shame. Dnsimple support for the ALIAS record is great. It's a must have not only for Heroku, but other similar PaaS services. Good links for those unfamiliar with their ALIAS support. * http://blog.dnsimple.com/2011/11/introducing-alias-record/ * http://support.dnsimple.com/articles/alias-record/ * http://support.dnsimple.com/articles/differences-between-a-cname-alias-url/ * http://blog.dnsimple.com/2014/01/why-alias-record/ * http://support.dnsimple.com/articles/domain-apex-heroku/ – Subfuzion Aug 20 '14 at 04:26
  • 1
    It's shocking that neither GCP nor AWS support these records yet. Here's a Cloud DNS feature request that folks should star / comment on to help encourage the feature to be developed: https://issuetracker.google.com/issues/38195246 – Abe Voelker Jan 11 '19 at 23:16
  • @AbeVoelker AWS supports ALIAS records in route 53: https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resource-record-sets-choosing-alias-non-alias.html – Stephen Ostermiller Dec 21 '21 at 09:59
4

Cloudflare ended up working for me (free plan), check out http://www.higherorderheroku.com/articles/cloudflare-dns-heroku/. Their onboarding is great, they walk you through changing your nameserver and automatically apply some magic ("CNAME flattening") when you set a CNAME record for the root domain.

Jay
  • 141
  • 2
  • This was viable, provided you want to take your DNS settings outside of Google Domains, and have GD simply point to a different name server. My goal was to keep everything on Google Domains and @travisR's answer allowed that. – Miro Aug 22 '16 at 16:48
-1

All the answers are correct that such is not possible.

But to add the hacks, I'm writing what I did:

I went to site24x7 and looked up the DNS to which I wanted to point to. It gives a whole list of IP addresses that the DNS points to. Then, I added an A record with all those address in the root domain.

This is totally free, very easy to configure but with one downside. Heroku, or whatever other provider you have, may choose to change all of those IP addresses and your setup will fail. This seems like a remote possibility as long as your site is live. I haven't faced it in the last few months- since February 2016.