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 change at reboot ...

Discussion in 'General Discussion' started by Spiral, Aug 16, 2005.

  1. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    Here is one that has been puzzling me for quite some time ....

    Whenever I reboot the server, it forgets it's hostname and reverts back to "localhost"
    forcing me to have to put the original hostname back in again. Everything is fine
    as long as I don't reboot the server and that also includes rebooting from WHM.

    For the moment, my fix is to have a cronjob wake up just after reboot and
    change the hostname back to the original hostname but does anyone have
    any idea why it is dropping the hostname in the first place?
     
  2. vwiley1

    vwiley1 Well-Known Member

    Joined:
    Oct 4, 2003
    Messages:
    87
    Likes Received:
    0
    Trophy Points:
    6
    Well my problem is similar.. Here is my /etc/hosts

    127.0.0.1 localhost
    xx.xx.xx.xx server1.mydomain.com server1

    Problem is.. mydomain.com is not correct.. I made a typo.

    So I go to change my hostname to the correct domain, but after every reboot it reverts back to the wrong domain again.
     
  3. AndyReed

    AndyReed Well-Known Member
    PartnerNOC

    Joined:
    May 29, 2004
    Messages:
    2,222
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Minneapolis, MN

    To fix your problem, see my post at: http://forums.cpanel.net/showthread.php?t=41686&highlight=hostname
     
  4. vwiley1

    vwiley1 Well-Known Member

    Joined:
    Oct 4, 2003
    Messages:
    87
    Likes Received:
    0
    Trophy Points:
    6
    Unfourtunatly I have already tried that. I even added an extra step but it still doesn't work.

    Change HostName in WHM
    root@rack1 pico /etc/hosts
    root@rack1 hostname rack1.correctdomain.com
    root@rack1 pico /etc/httpd/conf/httpd.conf
    root@rack1 pico /etc/wwwacct.conf
    root@rack1 pico /etc/sysconfig/network

    Most of these files accept the change, and don't revert back. /etc/hosts definantly reverts back everytime though.
     
Loading...

Share This Page