So you made a WHM server on Google Cloud and before you get to use it suddenly its broken?  I feel your pain.  Not sure when this started but it seems Google Cloud auto writes over the hostname.  Usually not an issue but cPanel seems to rely upon this entry to the point when you type a FQDN like Louisville, Kentucky.data502.com it changes to rubbish in a redirect and the site can’t be resolved.

cPanel Has A Fix.

You can see it from their site or I have the steps below.

To configure VPS deployments, many cloud hosting providers use the dhclient script, which includes the configuration of the instance’s hostname.

The dhclient script may not preserve the locally-configured hostname, so hosting providers use scripts to work around this issue. For example, Google Cloud Platform Services™ uses the google_set_hostname script.

The workaround scripts may interfere with WHM’s Change Hostname feature (WHM >> Home >> Networking Setup >> Change Hostname), which causes hostname configuration issues and a locked cPanel & WHM license.

The solution

To resolve this issue, you must create a dhclient exit hook script to set the hostname properly.
Create the set-hostname.sh file with the following contents in the /etc/dhcp/dhclient-exit-hooks.d/ directory, where hostname.example.com represents your server’s new hostname:

You can also create the file with the following command, where hostname.example.com represents your server’s new hostname: Note in the code below you should be sudo and hostname.example.com will need to be changed

mkdir -p /etc/dhcp/dhclient-exit-hooks.d/ && echo -ne ‘#!/bin/shnhostname hostname.example.comn/scripts/fixetchostsn’ > /etc/dhcp/dhclient-exit-hooks.d/zzz-set-hostname.sh && chmod +x /etc/dhcp/dhclient-exit-hooks.d/zzz-set-hostname.sh

OR You can make it in a drawn out 3 step process.

  1. #!/bin/sh
  2. hostname hostname.example.com
  3. /scripts/fixetchosts

That should keep the name as you intended.

SEO (UltimateSeo.org).org%2Fhostname-on-cpanel-whm-server-resets-to-project-name-on-google-cloud-fix%2F&linkname=Hostname%20On%20cPanel%20%2F%20WHM%20Server%20Resets%20To%20Project%20Name%20On%20Google%20Cloud%20Fix” title=”Facebook” rel=”nofollow noopener” target=”_blank”>SEO (UltimateSeo.org).org%2Fhostname-on-cpanel-whm-server-resets-to-project-name-on-google-cloud-fix%2F&linkname=Hostname%20On%20cPanel%20%2F%20WHM%20Server%20Resets%20To%20Project%20Name%20On%20Google%20Cloud%20Fix” title=”Twitter” rel=”nofollow noopener” target=”_blank”>SEO (UltimateSeo.org).org%2Fhostname-on-cpanel-whm-server-resets-to-project-name-on-google-cloud-fix%2F&linkname=Hostname%20On%20cPanel%20%2F%20WHM%20Server%20Resets%20To%20Project%20Name%20On%20Google%20Cloud%20Fix” title=”Google+” rel=”nofollow noopener” target=”_blank”>SEO (UltimateSeo.org).org%2Fhostname-on-cpanel-whm-server-resets-to-project-name-on-google-cloud-fix%2F&title=Hostname%20On%20cPanel%20%2F%20WHM%20Server%20Resets%20To%20Project%20Name%20On%20Google%20Cloud%20Fix” data-a2a-url=”https://ultimateSEO (UltimateSeo.org).org/hostname-on-cpanel-whm-server-resets-to-project-name-on-google-cloud-fix/” data-a2a-title=”Hostname On cPanel / WHM Server Resets To Project Name On Google Cloud Fix”>

The Article SEO (UltimateSeo.org).org/hostname-on-cpanel-whm-server-resets-to-project-name-on-google-cloud-fix/”>Hostname On cPanel / WHM Server Resets To Project Name On Google Cloud Fix appeared first on SEO (UltimateSeo.org).org/”>Ultimate SEO (UltimateSeo.org).