• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

02 7903 0216

     

Open Ticket

    

Client Area

FASTDOT Web Hosting Australia

FASTDOT Web Hosting Australia

Australian Cloud Hosting

  • Web Design
    • eCommerce Development
    • Branding
    • Web Design
  • Domains
    • Register
    • Domain FAQ
    • Domain Extensions
    • MyDNS Manager
    • Domain Transfer
  • Hosting
    • WordPress Hosting
    • Sydney cPanel Hosting
    • Magento Hosting – eCommerce Website
    • eCommerce Options
      • Managed Magento Hosting
      • PrestaShop Hosting
      • OpenCart Hosting
      • CS-Cart Hosting
    • Business Emails
  • Cloud Servers
    • VMware ESXi Hypervisor
    • Equinix – ISO Certified Data Centres
    • Cloud Hosting Info
    • Virtual Machines
  • Resources
    • Partner Program
    • Transferring Websites
    • WordPress Tips
    • Email Tutorials
    • Hosting in Australia
    • Apps Galore
    • Tutorials & News
      • SEO
      • VMware VPS Cloud
      • PHP and MySQL
      • Security
      • Linux Guides
      • Server Management
Order Now

Cloud-Based Hostname Workaround

December 20, 2018 by Editor

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 dhclient 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 for this while continuing to investigate a more permanent, long-term solution.

What is the issue?

For many cloud hosting providers, configuring automated deployments is done by invoking the dhclient 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 script.

However, this solution creates a new problem: these scripts may interfere with WHM’s Change Hostname feature (WHM >> Home >> Networking Setup >> Change Hostname). If your hostname is set in WHM to something that conflicts with the hostname set by the dhclient script, there will be problems in cPanel & WHM, up to and including the invalidation of the server’s cPanel Software license.

The workaround

To resolve this issue, you must create a dhclient exit hook script, 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, in the /etc/dhcp/dhclient-exit-hooks.d/ directory. In this example, replace hostname.example.com with your desired server hostname:

You can also use the below command to create the script, input the proper information, and set the file’s permissions correctly. Make sure to replace hostname.example.com with your desired hostname:

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

If you have any further questions or concerns, comment below, or reach out to us via our Slack or Discord channels, or join the discussion on the Official cPanel & WHM Subreddit!

More great articles

How to Set Up a Smarthost SMTP Relay with cPanel
Scale Up Your Hosting Business By Serving Your Customers
How to Take Professional Product Photos
UAPI- What’s New in 82

Category iconTutorials Tag iconProducts

Primary Sidebar

Recent Posts

  • How to Upload Files Using the cPanel File Manager?
  • How To Increase the PHP Max Upload Size in cPanel®?
  • Choosing a hosting platform in 2021
  • VARCHAR vs. TEXT for MySQL Databases
  • What Are the Best Shopify® Alternatives in 2021?
How To Install LiteSpeed Web Server and LiteSpeed Cache on cPanel
Force HTTPS Redirection
Getting Started With The cPanel® API
How to Take Time Off During the Holidays

Categories

  • Application Hosting
  • Australian Cloud Hosting
  • cPanel Hosting
  • DNS and Domains
  • eCommerce Hosting
  • Email Tutorials
  • Legals
  • Linux Tutorials
  • Operating Systems
  • PHP and MySQL
  • Register a Domain Name
  • Search Engine Optimization
  • Security
  • Server Management
  • Tutorials
  • VMware Cloud Hosting
  • Web Hosting Tutorials
  • WordPress Tips & Tricks
Australian web hosting

Footer

Recent Posts

  • How to Upload Files Using the cPanel File Manager?
  • How To Increase the PHP Max Upload Size in cPanel®?
  • Choosing a hosting platform in 2021
  • VARCHAR vs. TEXT for MySQL Databases
  • What Are the Best Shopify® Alternatives in 2021?

Legals

  • Terms&Conditions
  • SLA
  • Acceptable Usage Policies
  • Privacy Policies
  • About FASTDOT
  • ISO Certified

Contact

Australia: +61 02 7903 0216
Submit a Support Ticket

Company

FASTDOT.COM.AU PTY/LTD
ACN 002 454 631
200 Bourke Rd, Alexandria NSW 2015 Australia
Processing by eWay, PayPal and Bitcoin

blankNSW Government Provider

Made with in Sydney/Australia

Copyright © 2022 FASTDOT.COM

All rights reserved. Return to top