Symptoms
On Google Cloud Platform, the system hostname is changed either on boot or after some time. This can cause license errors.
Cause
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.
Resolution
Note: The following workaround scripts may interfere with WHM's Change Hostname feature, which causes hostname configuration issues and a locked cPanel & WHM license.
- Log in to the server via SSH or WHM's Terminal as the
rootuser Create the
/etc/dhcp/dhclient-exit-hooks.ddirectory:# mkdir -p /etc/dhcp/dhclient-exit-hooks.d/
Create the
zzz-set-hostname.shfile:# touch /etc/dhcp/dhclient-exit-hooks.d/zzz-set-hostname.sh
- Open
zzz-set-hostname.shin your preferred text editor Add the following information:
CONFIG_TEXT: #!/bin/sh
hostname $host.domain.tld
/scripts/fixetchostsNote: "$host.domain.tld" must be replaced with the server's hostname.
- Save the changes and exit the text editor
Set the executable permission on
zzz-set-hostname.sh:# chmod +x /etc/dhcp/dhclient-exit-hooks.d/zzz-set-hostname.sh
- Reboot the server.
Comments
0 comments
Article is closed for comments.