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!

Hostname can not change

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

Tags:
  1. Gojko

    Gojko Well-Known Member

    Joined:
    Nov 24, 2014
    Messages:
    69
    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:
    703
    Likes Received:
    114
    Trophy Points:
    168
    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
    
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    DjordjeB likes this.
  3. Gojko

    Gojko Well-Known Member

    Joined:
    Nov 24, 2014
    Messages:
    69
    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:
    703
    Likes Received:
    114
    Trophy Points:
    168
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
    Glad to hear it :)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    cPanelMichael likes this.
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,711
    Likes Received:
    1,793
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice