# 遵循安装指南后出现 DNS 问题

**URL:** https://meta.discourse.org/t/dns-problem-after-following-installation-guide/83212
**Category:** Self-hosting
**Created:** [2018年三月17日 17:03 UTC](https://meta.discourse.org/t/dns-problem-after-following-installation-guide/83212 "2018-03-17T17:03:37Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Judith](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/judith/32/289903_2.png) [@Judith](https://meta.discourse.org/u/Judith)
#### Post date: [2018年三月17日 17:03 UTC](https://meta.discourse.org/t/dns-problem-after-following-installation-guide/83212/1 "2018-03-17T17:03:38Z")

</div>

I followed the standard installation guide: setting up a new droplet on DigitalOcean, unpacking the Discourse image there, linking it up to our SparkPost mailer and so on. Everything works perfectly - kudos to the team for such a painless process! - and I can access the new site via the IP but not via its intended subdomain. I previously added subdomains to our site by setting up A records on Cloudflare pointing to the IP of the server, and having Apache virtual hosts on the server. This new droplet however doesn’t appear to be using Apache virtual hosts, and simply creating the A record on Cloudflare with the droplet IP doesn’t do anything - Cloudflare gives a 521 Webserver Down / connection refused error. What should I be doing?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2018年三月17日 21:39 UTC](https://meta.discourse.org/t/dns-problem-after-following-installation-guide/83212/2 "2018-03-17T21:39:16Z")

</div>

You generally edit DNS at the place where you purchased your domain name from. Cloudflare sounds right, if cloudflare is in charge of your DNS for that domain name.

Creating an A record for `forum.example.com` to the IP of your VPS should work, assuming the target ip is a VPS running only Discourse.

---

<div class="post-metadata">

### Author: ![Judith](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/judith/32/289903_2.png) [@Judith](https://meta.discourse.org/u/Judith)
#### Post date: [2018年三月18日 09:59 UTC](https://meta.discourse.org/t/dns-problem-after-following-installation-guide/83212/3 "2018-03-18T09:59:34Z")

</div>

Yes, all our DNS are set on Cloudflare, and the VPS only runs Discourse. However, creating the A record was not enough; it’s not working. I can access Discourse through the IP but not through the subdomain.

Any ideas what might be wrong?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2018年三月19日 23:26 UTC](https://meta.discourse.org/t/dns-problem-after-following-installation-guide/83212/4 "2018-03-19T23:26:49Z")

</div>

That’s odd, I don’t have any ideas – the A record pointing to the IP address should work, provided you’ve followed our install guide closely and haven’t deviated from the install steps.

I am not sure what you mean by

> having Apache virtual hosts on the server

since that is _not_ part of the install guide.

---

<div class="post-metadata">

### Author: ![schleifer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/schleifer/32/86416_2.png) [@schleifer](https://meta.discourse.org/u/schleifer)
#### Post date: [2018年三月20日 16:19 UTC](https://meta.discourse.org/t/dns-problem-after-following-installation-guide/83212/5 "2018-03-20T16:19:33Z")

</div>

521 is not a standard error – It means that you are connecting to cloudflare and cloudflare is unable to reach the origin. I would set the DNS to bypass cloudflare and connect directly to the instance. At the very least that will give a more useful error message.

---

<div class="post-metadata">

### Author: ![dnsmichi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dnsmichi/32/379505_2.png) [@dnsmichi](https://meta.discourse.org/u/dnsmichi)
#### Post date: [2018年三月20日 22:24 UTC](https://meta.discourse.org/t/dns-problem-after-following-installation-guide/83212/6 "2018-03-20T22:24:21Z")

</div>

Is that already public so one could look into DNS resolution and possible issues?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2018年三月21日 02:28 UTC](https://meta.discourse.org/t/dns-problem-after-following-installation-guide/83212/7 "2018-03-21T02:28:24Z")

</div>

@judith if cloudflare is involved here make sure all “flaring” is turned off for this domain name, the _only_ thing you want from cloudflare is DNS resolution.

---

<div class="post-metadata">

### Author: ![Judith](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/judith/32/289903_2.png) [@Judith](https://meta.discourse.org/u/Judith)
#### Post date: [2018年三月21日 21:06 UTC](https://meta.discourse.org/t/dns-problem-after-following-installation-guide/83212/9 "2018-03-21T21:06:53Z")

</div>

I was about to post more error details, but then I noticed that turning “flaring” off seems to have improved the situation: the forum is now available via http, just not https like the rest of the domain. Thank you @codinghorror for the idea!

[discuss.diem25.org](http://discuss.diem25.org)

---

<div class="post-metadata">

### Author: ![dnsmichi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dnsmichi/32/379505_2.png) [@dnsmichi](https://meta.discourse.org/u/dnsmichi)
#### Post date: [2018年三月22日 09:39 UTC](https://meta.discourse.org/t/dns-problem-after-following-installation-guide/83212/10 "2018-03-22T09:39:12Z")

</div>

I would advise you to complete the registration process after the setup wizard was finished, as otherwise one can annoy you with admin account registration mails (and your admin email is visible to the public domain).
