大网数据广告活动
网站运营与故障问答

Is there a way to forward my Google domain root to www?

· 52CE 我爱测

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?

问题原文

原帖链接 · James Anderbard · CC BY-SA 4.0

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?

已采纳解答

原帖链接 · Stephen Ostermiller · CC BY-SA 4.0

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

  1. Sign in to Google Domains.
  2. Click the domain name.
  3. Open the menu Menu, if applicable.
  4. Click Website.
  5. Click Add a forwarding address.
  6. Click Edit.
  7. Click + Forward a subdomain.
  8. Enter the subdomain you want to forward.
  9. In the Forward to field enter the URL you want to forward it to.
  10. 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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2021-12-21)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。