Hostname reset issue after the Reboot-OpenVZ VPS: hostname is changed to a non-FQDN

Have more questions? Submit a request

Applicable to:

  • SolusVM

Symptoms 

Configured a hostname for the containers on SolusVM, every time the container is rebooted, the hostname is changed to a non-FQDN.

Cause

CentOS 7 Template issue.

Resolution

  1. Connect to OpenVZ node via SSH
  2. Edit the file: /etc/vz/dists/scripts/redhat-set_hostname.sh

    Change this section:

    CONFIG_TEXT: if [ -f /etc/hostname ]; then
    # New style: RHEL7/Fedora15+
    # Note hostname(5) says it should NOT be FQDN
    # val=${val%%.*} <--- Commented this out
    echo "$val" > /etc/hostname <--- Added this

 

Articles in this section

Was this article helpful?
0 out of 0 found this helpful
Share

Comments

0 comments

Please sign in to leave a comment.