# Using Cloudflare, should the Name Server use Cloudflare settings, or stick with the host servers settings?

**URL:** https://meta.discourse.org/t/using-cloudflare-should-the-name-server-use-cloudflare-settings-or-stick-with-the-host-servers-settings/96154
**Category:** Self-hosting
**Created:** [September 1, 2018, 2:18pm UTC](https://meta.discourse.org/t/using-cloudflare-should-the-name-server-use-cloudflare-settings-or-stick-with-the-host-servers-settings/96154 "2018-09-01T14:18:08Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![Andy02](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/andy02/32/119498_2.png) [@Andy02](https://meta.discourse.org/u/Andy02)
#### Post date: [September 1, 2018, 2:18pm UTC](https://meta.discourse.org/t/using-cloudflare-should-the-name-server-use-cloudflare-settings-or-stick-with-the-host-servers-settings/96154/1 "2018-09-01T14:18:09Z")

</div>

Hi, i have our site spread out across three servers, with Discourse on its own server. Right now the name server on the server hosting Discourse is set to use the default values ([ns1.digitalocean.com](http://ns1.digitalocean.com), ns2, etc).

As the entire site is connected and piped through cloudflare, should i update the nameservers on the server Discourse is running on using the cloudflare values instead? or leave it as it is now?

Thank you.

---

<div class="post-metadata">

### Author: ![tehspaceg](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tehspaceg/32/119558_2.png) [@tehspaceg](https://meta.discourse.org/u/tehspaceg)
#### Post date: [September 1, 2018, 9:47pm UTC](https://meta.discourse.org/t/using-cloudflare-should-the-name-server-use-cloudflare-settings-or-stick-with-the-host-servers-settings/96154/2 "2018-09-01T21:47:08Z")

</div>

In order for Cloudflare to be used at all, the nameserver for your domain name needs to be through Cloudflare.

---

<div class="post-metadata">

### Author: ![jameshahnii](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jameshahnii/32/108982_2.png) [@jameshahnii](https://meta.discourse.org/u/jameshahnii)
#### Post date: [September 1, 2018, 9:55pm UTC](https://meta.discourse.org/t/using-cloudflare-should-the-name-server-use-cloudflare-settings-or-stick-with-the-host-servers-settings/96154/3 "2018-09-01T21:55:47Z")

</div>

My domain is registered at Namecheap. Namecheap points at Cloudflare nameservers. Cloudflare points at Digital Ocean droplet and Mailgun. Looks like this… be sure to turn off the orange cloud.

 ![08](https://global.discourse-cdn.com/meta/original/3X/1/4/14f633ad818efb2e9238dbbb2b7f6765eef23967.png)

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [September 1, 2018, 10:03pm UTC](https://meta.discourse.org/t/using-cloudflare-should-the-name-server-use-cloudflare-settings-or-stick-with-the-host-servers-settings/96154/4 "2018-09-01T22:03:00Z")

</div>

> [@jameshahnii](#):
>
> be sure to turn off the orange cloud

You can safely use the Cloudflare proxy after installation completes. Let’s Encrypt doesn’t like it initially, but it uses a different method to renew than enrol.

There is a Cloudflare template which needs adding to the app.yml to get the correct source IPs.

---

<div class="post-metadata">

### Author: ![jameshahnii](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jameshahnii/32/108982_2.png) [@jameshahnii](https://meta.discourse.org/u/jameshahnii)
#### Post date: [September 1, 2018, 10:05pm UTC](https://meta.discourse.org/t/using-cloudflare-should-the-name-server-use-cloudflare-settings-or-stick-with-the-host-servers-settings/96154/5 "2018-09-01T22:05:55Z")

</div>

Great. I didn’t know. Where can I find the template … or is that added automatically once you turn it back on?

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [September 1, 2018, 10:06pm UTC](https://meta.discourse.org/t/using-cloudflare-should-the-name-server-use-cloudflare-settings-or-stick-with-the-host-servers-settings/96154/6 "2018-09-01T22:06:28Z")

</div>

It’s in /var/discourse/templates if memory serves.

---

<div class="post-metadata">

### Author: ![jameshahnii](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jameshahnii/32/108982_2.png) [@jameshahnii](https://meta.discourse.org/u/jameshahnii)
#### Post date: [September 1, 2018, 10:23pm UTC](https://meta.discourse.org/t/using-cloudflare-should-the-name-server-use-cloudflare-settings-or-stick-with-the-host-servers-settings/96154/7 "2018-09-01T22:23:20Z")

</div>

Indeed it was. Copy/pasted into app.yml, ran `./launcher rebuild app` and got this error…

```
FAILED
--------------------
Pups::ExecError: /tmp/add-cloudflare-ips failed with return #&lt;Process::Status: pid 5910 exit 2&gt;
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params "/tmp/add-cloudflare-ips"
2b27a4ac57cf9e8f76602ca570ebffce817a001e36a0c898195199d32c63a1d6
**FAILED TO BOOTSTRAP** please scroll up and look for earlier error messages

```

Guessing I needed to do more than copy/paste the template?

---

<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: [September 1, 2018, 10:32pm UTC](https://meta.discourse.org/t/using-cloudflare-should-the-name-server-use-cloudflare-settings-or-stick-with-the-host-servers-settings/96154/8 "2018-09-01T22:32:00Z")

</div>

I still would not recommend sending all traffic through cloudflare, unless you have a compelling reason to do so (as in you frequently get ddosed).

---

<div class="post-metadata">

### Author: ![jameshahnii](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jameshahnii/32/108982_2.png) [@jameshahnii](https://meta.discourse.org/u/jameshahnii)
#### Post date: [September 1, 2018, 10:33pm UTC](https://meta.discourse.org/t/using-cloudflare-should-the-name-server-use-cloudflare-settings-or-stick-with-the-host-servers-settings/96154/9 "2018-09-01T22:33:18Z")

</div>

Noted. Turned off again. Thank you.

---

<div class="post-metadata">

### Author: ![Andy02](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/andy02/32/119498_2.png) [@Andy02](https://meta.discourse.org/u/Andy02)
#### Post date: [September 1, 2018, 10:53pm UTC](https://meta.discourse.org/t/using-cloudflare-should-the-name-server-use-cloudflare-settings-or-stick-with-the-host-servers-settings/96154/10 "2018-09-01T22:53:04Z")

</div>

That’s very interesting @codinghorror, I’ve never heard that before. why would you recommend turning them all off?

We have 6 subdomains across three servers, in a fairly complicated build, they all have the little cloud switched on. We’ve also had issues with not being able to auto-renew our Lets-Encrypt, is that likely to be the issue we’ve had?

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [September 1, 2018, 10:56pm UTC](https://meta.discourse.org/t/using-cloudflare-should-the-name-server-use-cloudflare-settings-or-stick-with-the-host-servers-settings/96154/11 "2018-09-01T22:56:34Z")

</div>

Do a search for Cloudflare here on meta; there are periodic reports of one or the other of Cloudflare’s optimisations breaking Discourse (and probably other JavaScript-heavy applications).

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [September 1, 2018, 10:57pm UTC](https://meta.discourse.org/t/using-cloudflare-should-the-name-server-use-cloudflare-settings-or-stick-with-the-host-servers-settings/96154/12 "2018-09-01T22:57:00Z")

</div>

It’s easy to use a rule to disable any disruptive features.

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [September 1, 2018, 10:58pm UTC](https://meta.discourse.org/t/using-cloudflare-should-the-name-server-use-cloudflare-settings-or-stick-with-the-host-servers-settings/96154/13 "2018-09-01T22:58:15Z")

</div>

Assuming you can identify which feature it is that is causing the problem this time, sure. It’s certainly a lot easier just to not use Cloudflare proxying.
