I am following the guide Google Domains: How to Forward the Root to www, but I do not see the option in my Google Domains DNS configuration to specify a synthetic record. Does anyone know how I can do this?
1 Answer
If you are hosting with Heroku, they require that your DNS records all point to them by name, not by IP address. They reserve the right to change the IP address of your website at any time just by changing the DNS for the subdomains they assign to you.
There is no way to use Google Domains as your DNS host and have the domain apex (no-www) point to a name. Many DNS providers allow proxy records (also called ANAME, or ALIAS records) for the domain apex that are entered like CNAME
records but where the DNS server periodically looks up the IP address and serves an A
record. Google offers no such functionality. See Does Google Domains support CNAME-like functionality at the zone apex?
You are left with a couple other options:
Redirect no-www using a "synthetic record" at Google
Google has instructions here
- Sign in to Google Domains.
- Click the domain name.
- Open the menu Menu, if applicable.
- Click Website.
- Click Add a forwarding address.
- Click Edit.
- Click + Forward a subdomain.
- Enter the subdomain you want to forward.
- In the Forward to field enter the URL you want to forward it to.
- Click Forward.
Presumably they have a way of specifying the root domain as a subdomain. It is usually denoted as a blank subdomain or with @
.
If you want the redirect to work over HTTPS, you'll have to then follow Google's instructions for getting a security certificate and adding it to Google Domains.
Use a better DNS host
You can keep your domain registered at Google domains but find DNS hosting elsewhere. There are many DNS hosts that now support ANAME/ALIAS records. To use such a host you would have to set your NS
records at Google domains to values that your new DNS host gives you. Then you can set up all your records at your new DNS host.
-
Thanks, Stephen. I changed to using AWS Route 53 DNS and was able to get it set up Commented Dec 21, 2021 at 19:34
-
Good choice. I use both Route53 and Cloudflare for DNS depending on the needs of a particular domain. Commented Dec 21, 2021 at 19:44
-
I was able to get this to work with Google Domain forwarding (chose forward path option as well) Commented Jan 22 at 14:14
-
Forwarding services issue redirects. They often don't support HTTPS. They often won't let you forward the domain apex while pointing the
www
subdomain to a CNAME. From their documentation, it appears that Google forwarding does support HTTPS and may be configurable by subdomain. So Google's forwarding services look better than those from most other providers. Commented Jan 22 at 14:31
When you set up web forwarding, Google Domains creates a web forwarding synthetic record...
Sincewww
is technically a subdomain of your root domain (see the "Domain Forwarding Values" section), you'll need to use the steps under "Forward your subdomain" in the above link.