Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Hostname can not change

Discussion in 'Bind / DNS / Nameserver Issues' started by DjordjeB, Mar 16, 2017.

Tags:
  1. DjordjeB

    DjordjeB Well-Known Member

    Joined:
    Nov 24, 2014
    Messages:
    49
    Likes Received:
    6
    Trophy Points:
    8
    Location:
    Macedonia
    cPanel Access Level:
    Root Administrator
    VPS, on HOST i set hostname, on /etc/hosts and /etc/sysconfig/network there is hostname what i want but in WHM in "change hostname" i have only "server1" of "server1.domain.tld"

    When i change in WHM to "server1.domain.tld" everything is ok with change log... But when i reboot vps hostname back to "server1"

    So what i need to do?
     
  2. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    599
    Likes Received:
    92
    Trophy Points:
    153
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
    Are you using OpenVZ and Centos7? Its an issue with SolusVM I believe.

    1. Set the hostname in WHM
    2. in SSH run:
    Code:
    # chattr +i /etc/hostname
    
    Reboot, it will stick.

    In the future, if you need to change the hostname you have to run:

    Code:
    # chattr -i /etc/hostname
    
     
    DjordjeB likes this.
  3. DjordjeB

    DjordjeB Well-Known Member

    Joined:
    Nov 24, 2014
    Messages:
    49
    Likes Received:
    6
    Trophy Points:
    8
    Location:
    Macedonia
    cPanel Access Level:
    Root Administrator
    You are right. That was it. Solved.
     
  4. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    599
    Likes Received:
    92
    Trophy Points:
    153
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
    Glad to hear it :)
     
  5. Sagar.webhost

    Sagar.webhost Member

    Joined:
    Mar 9, 2017
    Messages:
    15
    Likes Received:
    4
    Trophy Points:
    3
    Location:
    IN
    cPanel Access Level:
    Root Administrator
    Hello,

    Yes chattr will solve issue. Changing hostname on node end also required as when VPS restart it use hostname which is set in configuration of vps on node. Once it is changed on node end no need of chattr.
     
    cPanelMichael likes this.
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,427
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    You may want to report the issue to your VPS hosting provider instead of adding the immutable attribute to the
    /etc/hostname file. They should be able to provide you with instructions on how to save a new hostname to your VPS configuration.

    Thank you.
     
Loading...

Share This Page