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.

A suggestion for cPanel -- Hostname Change

Discussion in 'General Discussion' started by trakwebster, Feb 26, 2003.

  1. trakwebster

    trakwebster Well-Known Member

    Joined:
    Jan 29, 2003
    Messages:
    145
    Likes Received:
    0
    Trophy Points:
    16
    Our new managed server was installed with the wrong hostname. No problem, I thought, and used the WHM to change the hostname.

    It did change the hostname, but maybe not everywhere --

    1) The reverse DNS entry still showed the original, wrong hostname.

    2) Apache's httpd.conf file still showed the original. wrong hostname in ServerName and ServerAdmin equates.

    3) There may be an original wrong hostname somewhere in the exim (sendmail) system, or maybe the emails from something@oldwong.hostname.com have been created by the bad reverse DNS. I am too ignorant in this area to know, and haven't found the exim config files yet.

    Anybody else ever do a hostname change via WHM, and then needed to patch up a few places where WHM did not change the hostname for you?

    -- Arthur Cronos



    PS: One other thing. When setting up WHM for the first time, I got a warning that told me that the 'hostname' needed to be a domain I owned and that it could not be any user on the system.

    Well, that was very ambiguous to me at the time. I didn't know if 'hostname', in that context, meant 'server', 'domain', 'domain.com', or 'server.domain.com'.

    Now after fiddling a bit, I'm pretty sure you meant that the 'hostname' is the first part, then 'domain.com' is the domain, and than the 'server name' is the whole thing. IE:
    hostname -- boogie
    domain -- shoes.com
    servername -- boogie.shoes.com

    Is this correct? If so, a definition or example during that set-up script (and in the manual) would avoid some confusion for cpanel users in future.
     
  2. cazapico

    cazapico Registered

    Joined:
    Mar 1, 2003
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Venezuela
    Same problem here

    I'm going to have to go and manually edit BIND and apache files.

    :mad:
     
  3. casey

    casey Well-Known Member

    Joined:
    Jan 17, 2003
    Messages:
    2,303
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    If there is trouble, it will find me
    Me, too. I am now getting errors saying Apache failed on server.domain.com, which was the old hostname. The new hostname is server2.domain.com. How do I get Apache to quit giving me those errors?
     
    #3 casey, Mar 4, 2003
    Last edited: Mar 18, 2003
  4. xsenses

    xsenses Well-Known Member

    Joined:
    Aug 29, 2002
    Messages:
    233
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Huntington Beach, Ca
    I have done a hostname change and got the details from the support guys at fastservers.
    This is what I did and everything works
    Edit: /etc/hosts (to reflect new hostname)
    Edit: httpd.conf servername
    Edit: /etc/wwwacct.conf (to reflect new nameservers)

    As well as the standard WHM changes and manual edit's of DNS zones.

    That's all I can remember, hope it helps.
     
  5. casey

    casey Well-Known Member

    Joined:
    Jan 17, 2003
    Messages:
    2,303
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    If there is trouble, it will find me
    Did you have to reboot the machine?
     
  6. xsenses

    xsenses Well-Known Member

    Joined:
    Aug 29, 2002
    Messages:
    233
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Huntington Beach, Ca
    I am not sure if you would need to completely reboot (I did), but it seems like atleast bind and apache would need to be restarted.
     
  7. casey

    casey Well-Known Member

    Joined:
    Jan 17, 2003
    Messages:
    2,303
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    If there is trouble, it will find me
    Thank you so much. I'll give it a try.
     
  8. casey

    casey Well-Known Member

    Joined:
    Jan 17, 2003
    Messages:
    2,303
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    If there is trouble, it will find me
    Seems to be working now. Thanks again.
     
  9. Soma

    Soma Member

    Joined:
    Feb 13, 2003
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    where do you setup reverse dns entries
     
  10. xsenses

    xsenses Well-Known Member

    Joined:
    Aug 29, 2002
    Messages:
    233
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Huntington Beach, Ca
    You don't, generally the datacenter or delegated authority for the IP will add the entry.
     
  11. Soma

    Soma Member

    Joined:
    Feb 13, 2003
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    I think they delegated me for my ip's or something thats what they told me
     
  12. Tom Pyles

    Tom Pyles Well-Known Member

    Joined:
    Apr 26, 2002
    Messages:
    254
    Likes Received:
    0
    Trophy Points:
    16
    Soma,
    Everytime we needed to set up reverse DNS, our datacenter had to do it for us. If you contact your provider, they should be able to easily set this up for you.
     
  13. ozzi4648

    ozzi4648 Guest

    That hostname feature is a useless feature. It really is.

    Do it manually then reboot the server. Its the only way to get things working properly.

    Edit

    /etc/resolv.conf
    /etc/hosts
    /etc/sysconfig/network

    Reboot

    Whalla!
     
  14. trakwebster

    trakwebster Well-Known Member

    Joined:
    Jan 29, 2003
    Messages:
    145
    Likes Received:
    0
    Trophy Points:
    16
    Whalla you mean?

    Hi Ozzi4648,

    Thanks for the info. My server is running fine now as far as I can tell, but I'd never seen some of these files that you mention, so I looked at them.

    They all contain sensible information except the resolv.conf, which appears to contain darkorb's info --

    domain darkorb.net
    search darkorb.net
    nameserver 127.0.0.1
    nameserver 66.197.217.11
    nameserver 66.197.217.12

    What is this stuff? And do I leave it alone? Or change it to something else?

    -- Arthur Cronos from Voltos
     
  15. ozzi4648

    ozzi4648 Guest

    Re: Whalla you mean?

    Well i see nobody bothered to reply to your messages, typical around here. Anyway, that is wrong. You need to modify resolv.conf. Change

    domain darkorb.net to domain yourdomain.com
    search darkorb.net to search yourdomain.com

    Are those your nameserver ips? If so they are correct. If those are not the ips of your nameserver change them to reflect that.

    find /etc/hosts

    make sure yours says something like this

    # Do not remove the following line, or various programs
    # that require network functionality will fail.
    127.0.0.1 localhost
    207.xx.xxx.xxx srv08.domain.com srv08

    change 207.xx.xxx.xxx to your servers ip
    change srv08.domain.com to your.hostname.com
    change srv08 to the first letters before the first period in your hostname.

    If you dont know what your hostname is type

    hostname

    Next, find /etc/sysconfig/network

    pico network

    It should look something like this

    NETWORKING=yes
    HOSTNAME="srv08.domain.com"
    GATEWAY="207.xx.xxx.x"
    GATEWAYDEV="eth0"
    FORWARD_IPV4="yes"

    Chane HOSTNAME above to reflect the name of your hostname. Dont modify anything else

    Reboot if you made any change to the above files.
     
    #15 ozzi4648, Mar 15, 2003
    Last edited by a moderator: Mar 15, 2003
  16. trakwebster

    trakwebster Well-Known Member

    Joined:
    Jan 29, 2003
    Messages:
    145
    Likes Received:
    0
    Trophy Points:
    16
    And Whalla!

    Hi again, Ozzi4648,

    Actually it was only 15 minutes ago that I posted my question about resolv.conf, and here I have an answer (from you) almost immediamento!

    The hosts and network files were fine, containing my correct information.

    It was only the resolv.conf that contains somebody elses. No those aren't my IPs, except I suppose 127.0.0.1 might be correct for me as well as anybody.

    I will change them to my IPs and domain info. But if this file is used, how is it that the server has been apparently working OK? What is the usage for which resolv.conf is designed?

    Thanks for taking the time to fill me in.

    -- Arthur Cronos from Voltos
     
  17. ozzi4648

    ozzi4648 Guest

    Re: And Whalla!

    Are you running your own DNS. You need to change that information. Are you sure it was working? Probably not optimally anyway.
     
  18. trakwebster

    trakwebster Well-Known Member

    Joined:
    Jan 29, 2003
    Messages:
    145
    Likes Received:
    0
    Trophy Points:
    16
    Hmmm. Optimally ...

    Hi Ozzi4648,

    From what I could see of the DNS entries, they looked OK. (I'm a bit too ignorant to feel certain of what it *should* look like, but at least none of the old name was in there, and all the numbers and names were mine.)

    The tech at the NOC -- upon my query -- said he found an error in the 'Reverse DNS' and he fixed that for me. I gather that the 'Reverse DNS' is something like the third string on a three-string mandolin (Bass, Treble, Reverse), and it's something that I cannot look at for myself.

    But now you've got me worried. I don't know if it's running optimally. It runs, that's all I know.

    Hmmm.
     
  19. domainwala

    domainwala Registered

    Joined:
    Dec 26, 2003
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Delhi
    Any guide?

    Is there any official guide to change hostname with step by step instructions for latest whm?
     
  20. dreamwiz

    dreamwiz Well-Known Member

    Joined:
    Aug 28, 2003
    Messages:
    93
    Likes Received:
    0
    Trophy Points:
    6
    I had same problems with my server, the hostname was old and wrong, though I had changed it from every possible place. It took a complete reboot of the server and the problem was fixed immediately. So when your getting a new server, first fix the new hostname, reboot, then go on with your configuration. :)
     
Loading...

Share This Page