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.

Unable to change hostname permanently

Discussion in 'General Discussion' started by nobodyk, Aug 1, 2010.

  1. nobodyk

    nobodyk Well-Known Member

    Joined:
    Aug 1, 2010
    Messages:
    90
    Likes Received:
    0
    Trophy Points:
    6
    In whm, my hostname is "mydomain". I changed it to "server1.mydomain.com" as recommended by whm. When I change the hostname, I have to run "/scripts/rebuildhttpdconf" because some sites get the default cpanel homepage. The problem is that when I reboot my VPS, it changes the hostname back to "mydomain." I tried deleting my old hostname by doing pico to my host file, but still no luck.

    I don't know if this means anything, but under "Nameserver IPs" I have only one nameserver. Which is ns1.mydomain.com
     
  2. Deepika

    Deepika Registered

    Joined:
    Jul 23, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    1. You need to change hostname by using following command on the server.
    2. Also need to change the entry in file the following file.
    3. After correcting the hostname entries via shell login into your WHM go to the path and correct the hostname entry :
    Main >> Server Configuration >> Basic cPanel/WHM Setup

    4. Once this done go to the following path in your WHM.
    Main >> Networking Setup >> Change Hostname
    Click on the change tab next to "New Hostname"

    5. Last step is go to the path
    Main >> DNS Functions >> Add an A Entry for your Hostname
    You will see the hostname and Server main IP click "Add Entry" Tab

    Regards,
    Deepika :)
     
  3. nobodyk

    nobodyk Well-Known Member

    Joined:
    Aug 1, 2010
    Messages:
    90
    Likes Received:
    0
    Trophy Points:
    6
    I'm afraid I already had those settings. The problem is that when I reboot the hostname changes.
     
  4. arunsv84

    arunsv84 Well-Known Member

    Joined:
    Oct 20, 2008
    Messages:
    373
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    127.0.0.1
    cPanel Access Level:
    Root Administrator
    Hostname change

    Hi,

    Have you changed the hostname in /etc/hosts ?

    Please edit /etc/hosts and enter the line

    ipaddress hostname

    Let me know the results.
     
  5. nobodyk

    nobodyk Well-Known Member

    Joined:
    Aug 1, 2010
    Messages:
    90
    Likes Received:
    0
    Trophy Points:
    6
    Yes I have tried that already like I mentioned in my op. Is this something out of my hands and have to contact my VPS provider? or is this a whm misconfiguration?
     
  6. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,577
    Likes Received:
    40
    Trophy Points:
    48
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    sounds like your on a vps you need to set it at the node
     
  7. Miraenda

    Miraenda Well-Known Member

    Joined:
    Jul 28, 2004
    Messages:
    242
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Coralville, Iowa USA
    It's the main VPS that's resetting it. You'll need to contact your VPS provider if you don't manage the main VPS to ask them to correct the hostname on the main node to the full name.
     
  8. linux7802

    linux7802 Well-Known Member

    Joined:
    Dec 14, 2007
    Messages:
    232
    Likes Received:
    1
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Solution

    When ever you reboot VPS, VPS will check hostname entry in VPS hosted main node config file for your VPS. There for you have to contact your VPS provider and ask them to set the proper hostname for your VPS from main node as well as its better if you also ask your VPS provider to set rDNS for your hostname, so that you will not face any E-mail problem in future. :)
     
  9. jacampbe

    jacampbe Active Member

    Joined:
    Mar 19, 2008
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    6
    Unable to keep WHM / cPanel basic settings

    We're having a similar problem. However, in our case the hostname is not lost when we reboot our (CentOS 5) dedicated virtual server .....

    WHM >> Main >> Server Configuration >> Basic cPanel/WHM Setut
    Server Contact E-Mail Address is lost
    Nameservers are lost


    WHM >> Main >> Networking Setup >> Resolver Configuration
    The 2nd resolver server is lost

    Any thoughts ?
     
  10. nobodyk

    nobodyk Well-Known Member

    Joined:
    Aug 1, 2010
    Messages:
    90
    Likes Received:
    0
    Trophy Points:
    6
    yeah, I had to change my nameservers at the VPS level. That seem to worked.

    I also notice that in my container you can change the network resolvers, you should check that the IP resolvers are corrently entered at the VPS level. Use your VPS control panel or contact your host. That's what I did. Hope that helps.
     
Loading...

Share This Page