Using Cloudflare on server that has custom nameservers?

lewis-teck

Active Member
Apr 28, 2016
40
13
58
London
cPanel Access Level
Root Administrator
I have a website, domain.com, with a server hostname of server.domain.com

The domain.com website is used as a website, as is a few seperate sites like website1.com, website2.com and website3.com.

The other websites are using cloudflare to mask the server's IP address and make use of Cloudflare's other benefits.

What I would like to do, is make the domain.com website also protected by cloudflare. If it was a seperate site, that's easy, but my concern with setting up cloudflare or a similar service would be how it works with the server.

Will my server hostname, the custom nameservers I use on website1/2/3.com, AutoSSL, or any of the other features break because I would use cloudflare? When setting up custom nameservers, I have to provide certain information to my domain registrar, but wouldn't these be erased by changing my domain.com nameserves to cloudflare ones? Are there any other risks for applying this change to my main server's domain?

Thank you for any help.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,295
1,273
313
Houston
You wouldn't actually use custom nameservers with CloudFlare after you set it up, you'd use the nameservers CloudFlare provides to you. CloudFlare has some extensive documentation on how to set everything up here: Changing your domain nameservers to Cloudflare
 

ffeingol

Well-Known Member
PartnerNOC
Nov 9, 2001
637
210
343
cPanel Access Level
DataCenter Provider
As @cPanelLauren said, the easiest way to implement CloudFlare is have them be your name servers. There are some downsides, however. The biggest one is that the DNS does not get automatically update like it does if you use the cPanel DNS. If you add a sub-domain you'll need to make sure you set it up in CloudFlare's DNS. You also need to be a bit selective on what sub-domains you turn the proxy on. We've had clients turn it on for mail (i.e. mail.example.com) and that broke their email client. Finally we've had clients with issues going to example.com/cpanel and example.com/whm when example.com is proxied through CloudFlare. If your host uses sub-domains (i.e. cpanel.example.com and/or whm.example.com ) you can just make sure those are not proxied.
 
  • Like
Reactions: cPanelLauren

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,295
1,273
313
Houston
As @cPanelLauren said, the easiest way to implement CloudFlare is have them be your name servers. There are some downsides, however. The biggest one is that the DNS does not get automatically update like it does if you use the cPanel DNS. If you add a sub-domain you'll need to make sure you set it up in CloudFlare's DNS. You also need to be a bit selective on what sub-domains you turn the proxy on. We've had clients turn it on for mail (i.e. mail.example.com) and that broke their email client. Finally we've had clients with issues going to example.com/cpanel and example.com/whm when example.com is proxied through CloudFlare. If your host uses sub-domains (i.e. cpanel.example.com and/or whm.example.com ) you can just make sure those are not proxied.
Yep, the reason this happens is it pulls the records from where DNS is hosted initially. But once you change your nameservers you're hosting DNS with CloudFlare, it doesn't look back to your server anymore for those records. It's all possible to with CloudFlare you've just got to take extra steps to modify the records on CloudFlare once you make this change.
 

WorkinOnIt

Well-Known Member
Aug 3, 2016
227
30
78
UK
cPanel Access Level
Root Administrator
@lewis-teck I have done this and to be honest, it's easy once you know how, but it does take a bit of mucking about. My advice is to find a spare few hours, register half a dozen cheap domains and and set up a test server with e.g. digital ocean or vultr and then have a play - that way you're not risking any live sites.... but you need to have playtime - which is always tricky to find ;-)
 
  • Like
Reactions: cPanelLauren

Wajdan

Member
Sep 11, 2009
10
0
51
If you are only willing to use Cloudflare proxy service and not DNS then you may integrate cloudflare plugin with cPanel. This works with cNAME records to proxy traffic from cloudflare but local cPanel DNS are used.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,295
1,273
313
Houston
If you are only willing to use Cloudflare proxy service and not DNS then you may integrate cloudflare plugin with cPanel. This works with cNAME records to proxy traffic from cloudflare but local cPanel DNS are used.
The plugin as far as I am aware is not only just available to partners but is no longer being maintained so I would not recommend this course of action.
 
  • Like
Reactions: AzeDK

xeeaxe

Registered
Nov 10, 2019
1
0
0
Canada
cPanel Access Level
Root Administrator
I have a website, domain.com, with a server hostname of server.domain.com

The domain.com website is used as a website, as is a few seperate sites like website1.com, website2.com and website3.com.

The other websites are using cloudflare to mask the server's IP address and make use of Cloudflare's other benefits.

What I would like to do, is make the domain.com website also protected by cloudflare. If it was a seperate site, that's easy, but my concern with setting up cloudflare or a similar service would be how it works with the server.

Will my server hostname, the custom nameservers I use on website1/2/3.com, AutoSSL, or any of the other features break because I would use cloudflare? When setting up custom nameservers, I have to provide certain information to my domain registrar, but wouldn't these be erased by changing my domain.com nameserves to cloudflare ones? Are there any other risks for applying this change to my main server's domain?

Thank you for any help.
Hi @lewis-teck, were you able to solve this issue? What you're describing is exactly what I'm trying to do. Please let me know.

Cheers,
Xeeaxe