How to point Cloudflare domains to your WHM/cPanel hosting account

My hosting plan comes with WHM and a single cPanel account. I needed to set up a second site using an addon domain. I tried mapping that domain’s A record to my server’s shared IP address in Cloudflare. Unfortunately cPanel threw an error about using a different nameserver.

Here’s what the error message says:

This domain points to an IP address that does not use the DNS servers associated with this server. Transfer the domain to this server’s nameservers at the domain’s registrar or update your system to recognize the current DNS servers. To do this, use WHM’s Configure Remote Service IPs interface.

I went down a rabbit hole on Cloudflare’s support forum, finding other users reporting similar issues where they were trying to map a domain managed on Cloudflare to a cPanel addon domain.

In the end, the solution was in the cPanel support docs, albeit as a “not recommended” option:

3. [Not Recommended] Allow remote domains in general. Enable the Allow remote domains option in WHM before creating an addon domain that is considered “remote”. To do so:

  1. Access WHM.
  2. Navigate to Home » Server Configuration » Tweak Settings.
  3. Search for Allow remote domains.
  4. Enable this option and select Save.

It is best to only enable this setting temporarily to add the domain, then to disable it afterward. Refer to the description of the setting:

While it’s not the recommended approach, it does work, and assuming you’re not working on a live site or a site getting hit with a ton of traffic, flipping the switch for the minute it takes to set up the addon domain isn’t a huge issue.

Here’s what it looks like in WHM:

image

Flipping that on for a minute let me set up my addon domain.

When I was done, I disabled remote domains, and carried on with my work. Easy!

Leave a Comment