{"id":50817,"date":"2018-12-19T13:00:00","date_gmt":"2018-12-19T19:00:00","guid":{"rendered":"https:\/\/blog.cpanel.com\/?p=50817"},"modified":"2018-12-19T13:00:00","modified_gmt":"2018-12-19T19:00:00","slug":"cloud-based-hostname-workaround","status":"publish","type":"post","link":"https:\/\/devel.www.cpanel.net\/blog\/products\/cloud-based-hostname-workaround\/","title":{"rendered":"Cloud-Based Hostname Workaround"},"content":{"rendered":"
It’s very common these days for hosting providers to offer cloud-based hosting solutions to their customers. In configuring these servers ourselves, and in interactions with our customers’ servers, an issue has come to our attention where the For many cloud hosting providers, configuring automated deployments is done by invoking the However, this solution creates a new problem: these scripts may interfere with WHM’s Change Hostname<\/a><\/em> feature (WHM >> Home >> Networking Setup >> Change Hostname<\/em>). If your hostname is set in WHM to something that conflicts with the hostname set by the To resolve this issue, you must create a dhclient<\/a><\/code> script does not preserve locally-configured hostnames. This means that hostnames configured on the command line might not remain through a reboot. We wante to provide a workaround solution<\/a> for this while continuing to investigate a more permanent, long-term solution.<\/p>\n
What is the issue?<\/h2>\n
dhclient<\/code> script at boot-time, which includes configuring the server’s hostname incorrectly. Commonly, hosting providers will use additional scripting to work around this issue. For example, Google Cloud Engine uses the google_set_hostname<\/a> script.<\/p>\n
dhclient<\/code> script, there will be problems in cPanel & WHM, up to and including the invalidation of the server’s cPanel Software license.<\/p>\n
The workaround<\/h2>\n
dhclient<\/code> exit hook script<\/a>, which will then set the hostname properly at boot-time. You first create a script like the one below, which we have named
set-hostname.sh<\/code>, in the
\/etc\/dhcp\/dhclient-exit-hooks.d\/<\/code> directory. In this example, replace
hostname.example.com<\/a><\/code> with your desired server hostname:<\/p>\n