# 子域名的正确DNS设置

**URL:** https://meta.discourse.org/t/proper-dns-settings-for-subdomain/204582
**Category:** Self-hosting
**Created:** [2021年九月27日 18:54 UTC](https://meta.discourse.org/t/proper-dns-settings-for-subdomain/204582 "2021-09-27T18:54:23Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Kurtjt](https://avatars.discourse-cdn.com/v4/letter/k/4af34b/32.png) [@Kurtjt](https://meta.discourse.org/u/Kurtjt)
#### Post date: [2021年九月27日 18:54 UTC](https://meta.discourse.org/t/proper-dns-settings-for-subdomain/204582/1 "2021-09-27T18:54:23Z")

</div>

大家好，

有人能确认使用子域名指向 Discourse 的正确步骤吗？

我刚设置了一个试用版，当前 URL 是：

[https://outsidethelines.trydiscourse.com/](https://outsidethelines.trydiscourse.com/)

我希望将其指向我们的网站：

[https://nuitblanchewinnipeg.ca/](https://nuitblanchewinnipeg.ca/)

当我进入我们网站的 DNS 设置时，看到如下菜单：

 ![Untitled](https://global.discourse-cdn.com/meta/original/3X/1/d/1da2f5e08baa3d82090c9cc8ae8abe8027485a66.jpeg)

请告诉我“主机”和“指向”栏应填写什么内容。

TTL 是否意味着需要一小时服务器才能创建此记录？（我可以将其改为 10 分钟）

请给予指导。谢谢！

---

<div class="post-metadata">

### Author: ![Simsnet](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simsnet/32/72855_2.png) [@Simsnet](https://meta.discourse.org/u/Simsnet)
#### Post date: [2021年九月27日 18:59 UTC](https://meta.discourse.org/t/proper-dns-settings-for-subdomain/204582/2 "2021-09-27T18:59:47Z")

</div>

对于子域名，“主机”是指您希望访问者输入的内容。如果您愿意，可以填写 `forum.nuitblanchewinnipeg.ca`。也许仅使用单个单词也可以，但不太确定。

对于“指向”，请填写您的 `...trydiscourse.org` 链接。

TTL 可以保持为 1 小时。

---

<div class="post-metadata">

### Author: ![lucasbasquerotto](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lucasbasquerotto/32/133376_2.png) [@lucasbasquerotto](https://meta.discourse.org/u/lucasbasquerotto)
#### Post date: [2021年九月27日 20:21 UTC](https://meta.discourse.org/t/proper-dns-settings-for-subdomain/204582/3 "2021-09-27T20:21:38Z")

</div>

需要注意的是，仅使用 CNAME 可能不够，因为接收到的 Host 头将包含您网站的子域名，而 Discourse 容器期望它来自 [trydiscourse.org](http://trydiscourse.org)。

此外，[trydiscourse.org](http://trydiscourse.org) 上的 TLS 证书（用于启用 HTTPS）也期望该域名，而不是您论坛中的域名。

您可以尝试以下步骤：

> [@Configure your domain name for hosted Discourse](https://meta.discourse.org/t/configure-your-domain-name-for-hosted-discourse/21827):
>
> bookmark This guide explains how to configure a custom domain name for a site hosted by Discourse. This option is available for our Pro, Business, and Enterprise plans. person_raising_hand Required user level: Administrator So you’ve selected a hosted Discourse plan. Lucky you! The very first step is to point your domain name forum.example.com to our hosting. You will need to edit the DNS records for your domain name, example.com. In most cases, the DNS is controlled from the sa…

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [2021年九月27日 22:29 UTC](https://meta.discourse.org/t/proper-dns-settings-for-subdomain/204582/4 "2021-09-27T22:29:15Z")

</div>

有关如何为我们的托管站点配置域名的问题，最佳做法是通过托管站点管理仪表板上显示的“需要帮助”电子邮件地址，直接联系 Discourse 团队。您也可以直接在 Discourse Meta 论坛中通过向我们的 `team` 群组发送私信来联系团队。我们将很乐意为您提供帮助。

正如 Lucas 上面提到的，配置域名指向我们托管服务的详细信息请参阅：[https://meta.discourse.org/t/configure-your-domain-name-for-hosted-discourse/21827。不过，您需要从我们的支持团队获取您的站点所指向的](https://meta.discourse.org/t/configure-your-domain-name-for-hosted-discourse/21827%E3%80%82%E4%B8%8D%E8%BF%87%EF%BC%8C%E6%82%A8%E9%9C%80%E8%A6%81%E4%BB%8E%E6%88%91%E4%BB%AC%E7%9A%84%E6%94%AF%E6%8C%81%E5%9B%A2%E9%98%9F%E8%8E%B7%E5%8F%96%E6%82%A8%E7%9A%84%E7%AB%99%E7%82%B9%E6%89%80%E6%8C%87%E5%90%91%E7%9A%84) CNAME 目标地址。

---

<div class="post-metadata">

### Author: ![Kurtjt](https://avatars.discourse-cdn.com/v4/letter/k/4af34b/32.png) [@Kurtjt](https://meta.discourse.org/u/Kurtjt)
#### Post date: [2021年九月27日 23:07 UTC](https://meta.discourse.org/t/proper-dns-settings-for-subdomain/204582/6 "2021-09-27T23:07:14Z")

</div>

Simon，很高兴收到你的消息！经过反复尝试，我今天下午已经解决了。现在一切就绪。👌

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2024年九月5日 09:35 UTC](https://meta.discourse.org/t/proper-dns-settings-for-subdomain/204582/7 "2024-09-05T09:35:56Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
