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/Box name change question

Discussion in 'General Discussion' started by digitard, Apr 23, 2005.

  1. digitard

    digitard Well-Known Member

    Joined:
    Aug 13, 2004
    Messages:
    70
    Likes Received:
    0
    Trophy Points:
    156
    I know how to change the hostname in WHM. Thats no biggie and I know how to retrieve my box's hostname info from SSH.

    My question is this. I started my service w/ my dedicated hosting company with a single site name, and box name in mind. So I set it to go to my current site and my hostname to be server1.currentsite.com

    Now since then I have come to the decision the hosting site name sorta wasn't fit for a more 'global community' (it had to do w/ gaming) and I bought a new domain that I want to be my primary site because its a bit more global.

    So how do I:
    - Change my actual box's info to be primarily on the new server.
    - Change my hostname to something else so its not so blatantly server1/server2/etc

    If I need to do a PTR or anything I can do that through my providers control panel.
     
  2. DigitalN

    DigitalN Well-Known Member

    Joined:
    Sep 23, 2004
    Messages:
    420
    Likes Received:
    1
    Trophy Points:
    168
    Which OS?

    For redhat/centos this will change the hostname

    # hostname your.newhostname.com

    Replace the hostname in each of the following files, with the new one.

    /etc/hosts
    /etc/sysconfig/network

    Then

    Add a dns zone for your new domain name and hostname.

    Modify apache

    # replace 'old.hostname.com' 'your.newhostname.com' -- /usr/local/apache/conf/httpd.conf

    # /etc/init.d/httpd graceful

    # /etc/init.d/exim restart

    Restart exim so the new hostname will be in mail headers.

    Then add the new PTR record for the new hostname.
     
  3. digitard

    digitard Well-Known Member

    Joined:
    Aug 13, 2004
    Messages:
    70
    Likes Received:
    0
    Trophy Points:
    156
    I cant believe I forgot which OS. I was like 'remember to put Redhat' and then I forgot since it was so late...lol.

    Thanks. I'll give that a go as soon as I get to work.
     
  4. pro2call

    pro2call Member

    Joined:
    May 1, 2005
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    151
    Hi,

    How do i Add a dns zone for your new domain name and hostname.
     
  5. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,460
    Likes Received:
    21
    Trophy Points:
    463
    Location:
    Go on, have a guess
    For the hostname you have to edit the zone file for the domain that it is is and add an A record for the subdomain to point to the servers main IP address.
     
    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