1&1 域名重定向到 heroku 托管

1&1 domain name redirects to heroku hosting

我在 heroku 上正确部署了我的 node js 应用程序,它在 heroku 提供的域名下运行良好。

现在,我正在尝试 link 使用我的个人域名。在 heroku 网站上,在 heroku 托管的我的应用程序的设置部分,我将域名设置为 my-app.com,我的 heroku dns 设置为 my-app.com.herokudns.com

在 1&1 中,我注册了一个域名 my-app.com,我将其重定向到 www.my-app.com

仍然是 1&1,然后我创建了一个名为 www.my-app.com 的子域,我在其中将 DNS CNAME 设置为 my-app.com.herokudns.com

我保存了所有内容,但是当我转到 www.my-app.com 时,url 显示 www.my-app.com/defaultsite,其中内容显示一个 heroku 通用页面告诉我 There's nothing here, yet. Build something amazing

任何人都可以知道连接到我的应用程序可能缺少什么吗?

DNS 更改 take time to propagate through the network。很多时候,您需要等待才能看到它们生效。

通过设置您的记录 time to live (TTL) 可以稍微缓解这种情况。此值指定您的记录的到期时间,之后应从权威服务器重新获取缓存值:

Shorter TTLs can cause heavier loads on an authoritative nameserver, but can be useful when changing the address of critical services like Web servers or MX records, and therefore are often lowered by the DNS administrator prior to a service being moved, in order to minimize disruptions.

请注意,如果您计划更改 DNS 记录,则应在进行更改之前将其 TTL 降低到足够低的程度,以使旧值已经过期。例如,如果您计划更改的记录的 TTL 为 86400 秒(24 小时),您应该在修改其值之前至少减少 24 小时。