Cloud hosting is one of the various web hosting services that are offered by web hosting companies. Web hosting is a professional service, wherein server space is provided by web hosting service providers to the owners of websites so that they can store their websites’ files on those servers. All the essential services and the technologies that are needed to make a website accessible online are also provided in web hosting by the web hosting companies. The main types of web hosting plans are categorized into shared, dedicated, VPS, reseller, WordPress and Cloud hosting plans. In cloud hosting, multiple servers are used for load balancing and for maximising uptime. The most reputable web hosting service providers are commonly referred to as the “Top Cloud Hosting Company”, the “Best Website Hosting Company”, the “Best Windows Hosting Company” etc.
The Hostname Configuration Issue
Now, many cloud hosting service providers use the dhclient script in order to configure VPS deployments. This script includes the instance’s hostname’s configuration.
The dhclient script might not preserve the locally-configured hostname. That is why hosting service providers use scripts to resolve this issue. The workaround scripts might interfere with the Change Hostname feature of WHM. This can result in hostname configuration issues, along with a locked cPanel & WHM license. Let us describe the solution for this issue.
Solution for the Hostname Configuration Issue
The above-mentioned issue can be easily resolved by creating a dhclient exit hook script to set the hostname in a proper way.
You need to create the zzz-set-hostname.sh file. It should have the following contents in the directory, /etc/dhcp/dhclient-exit-hooks.d/ ;where hostname.example.com represents your server’s new hostname:
#!/bin/sh
hostname hostname.example.com
/scripts/fixetchosts
The below-mentioned command can also be used to create the file; where your server’s new hostname is represented by hostname.example.com :
mkdir -p /etc/dhcp/dhclient-exit-hooks.d/ && echo -ne ‘#!/bin/sh\nhostname hostname.example.com\n/scripts/fixetchosts\n’ > /etc/dhcp/dhclient-exit-hooks.d/zzz-set-hostname.sh && chmod +x /etc/dhcp/dhclient-exit-hooks.d/zzz-set-hostname.sh
It needs to be mentioned here that you should ensure that you set the zzz-set-hostname.sh file with 0755 permissions. If that is not done then the script will not run.
Comentários