gpt4 book ai didi

google-app-engine - 了解 Google App Engine 应用的 DNS 要求

转载 作者:太空宇宙 更新时间:2023-11-03 15:23:16 24 4
gpt4 key购买 nike

我有一个正在运行的 Google App Engine,并且我已经购买了一个域。为了将两者联系起来,我关注了the official guide。 .

具体而言,该指南建议设置这些 DNS 规则:

enter image description here

问题是,我同时拥有裸域 (site.com) 和 www 子域 (www.site.com)。按照指南,我设置了以下规则:

Type      Name               Value
A site.com. 216.239.32.21
A site.com. 216.239.34.21
A site.com. 216.239.36.21
A site.com. 216.239.38.21
(other AAAA for site.com.)
CNAME www.site.com. ghs.googlehosted.com

问题

认为我所做的是正确的,因为它有效:我可以同时输入 site.com 和 www.site.com 并被定向到我的应用程序。但是我对 www 子域有些困惑。

  1. 什么是 ghs.googlehosted.com ,为什么我需要 www 子域的 CNAME?为什么 www 没有 A 记录?

  2. 子域如何运作?我没有 A 记录,只有这个 CNAME,但它仍然指向我的 IP。

  3. 我不明白指南说的是:

Typically you list the host name along with the canonical name as the address. In our example, one of the records you would add is the host name www with the address ghs.googlehosted.com. (If you use a naked domain, you would use @ as the host name and a corresponding value from the Add new custom domain form.)

你能解释一下这一段的意思吗?这是什么@?

最佳答案

指南建议您使用其中一种 DNS 类型,使用 A 和 AAAA(IPv6) 或 CNAME。

1) 您可以为 www 子域使用 A 和 AAAA 记录。只需将 DNS 设置为

A         www.site.com.          216.239.38.21
(other AAAA for site.com.)

2) 您的 www 子域之所以有效,是因为您指向 www.site.com -> ghs.googlehosted.com。看到有www。在你的 site.com 之前

CNAME     www.site.com.      ghs.googlehosted.com

3) @用于表示当前原点。因此,当您使用 @ 时,它会转换为 site.com。

为了使事情更简单,我将只使用以下 DNS 条目。这样我的网站就可以通过裸域和 www 子域访问。

CNAME     www.site.com.      ghs.googlehosted.com
CNAME @ ghs.googlehosted.com

如果您只想通过裸域为您的网站提供服务。

CNAME     www.site.com.      site.com
CNAME @ ghs.googlehosted.com

这里我们将 www 子域指向裸域。

关于google-app-engine - 了解 Google App Engine 应用的 DNS 要求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39576443/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com