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.

Permanently set hostname in cpanel

Discussion in 'Workarounds and Optimization' started by noaptus, Oct 24, 2012.

  1. noaptus

    noaptus Member

    Joined:
    Mar 19, 2008
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Hi.

    I had this problem for some time and it was making me go nuts.

    When i restarted my virtuozzo vps server the hostname change.

    I wantet to permanently set the hostname for my VPS Server.

    to fix this after reboot do this.

    Go to your WHM login as root

    Home ┬╗Networking Setup ┬╗Change Hostname

    SSH to you server as root

    Do this commant

    #hostname server.yourdomain.com

    Then do this to se if you have set the hosname

    #hostname

    and the outcome should be
    #server.yourdomainname.com

    and do this

    #hostname -f

    and the outcome should be
    #server.yourdomainname.com

    Then go to vi /etc/sysconfig/network

    NETWORKING="yes"
    HOSTNAME=
    DOMAINNAME=

    Change the HOSTNAME= and the DOMAINNAME= to

    HOSTNAME=server.yourdomainname.com
    DOMAINNAME=yourdomainname.com

    so it would look like this

    NETWORKING="yes"
    HOSTNAME=server.yourdomainname.com
    DOMAINNAME=yourdomainname.com

    And finaly do this

    #cd etc/sysconfig

    and execute this command

    chattr +i network

    and now you have permanently set hostname in cpanel

    It's best to do this BEFORE you install cPanel on your server.

    I hope this help.

    Don't forget to say Thanks!

    Regards

    Adolf Bragi
     
    #1 noaptus, Oct 24, 2012
    Last edited: Oct 24, 2012
Loading...

Share This Page