Find the answer to your Linux question:
Results 1 to 10 of 10
Hi I have a vitual private server with fedora core 2 installed I would like to perminatly change the hostname I have edited /etc/hosts and /etc/sysconfig/network and changed the hostname ...
  1. #1
    Just Joined!
    Join Date
    Oct 2005
    Posts
    8

    Permintally changing host name

    Hi

    I have a vitual private server with fedora core 2 installed

    I would like to perminatly change the hostname

    I have edited /etc/hosts and /etc/sysconfig/network and changed the hostname

    After a reboot the files seem to revert back to the old hostname

    Can anyone advise if there is nothing I can do can I right a script that will run on statup to set the hostname.

    Thanks in advance

  2. #2
    Trusted Penguin Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,393
    use this tool as root:

    system-config-network

    the hostname is specified on the 'DNS' tab.
    Linux user #126863 - see http://linuxcounter.net/

  3. #3
    Just Joined!
    Join Date
    Oct 2005
    Posts
    8
    no that doesnot work after a reboot it defaults back to the old hostname

    I can not understand it

  4. #4
    Linux Guru anomie's Avatar
    Join Date
    Mar 2005
    Location
    Texas
    Posts
    1,692
    Try the
    Code:
    hostname new_name_here
    command.

    Are you updating the hostname via dhcp by any chance?

  5. #5
    Just Joined!
    Join Date
    Oct 2005
    Posts
    8
    hostname new-name is only temporary until re-boot

    thanks anyway

    box has a static ip and is a vitual server

  6. #6
    scm
    scm is offline
    Linux Engineer
    Join Date
    Feb 2005
    Posts
    1,044
    I'd have done exactly what you've done to change the hostname, so the fact that it's not working is a mystery to me. Have you got anything in /etc/hostname? If you have, and it's the old name, just delete the file and see if that resolves your problem.

  7. #7
    scm
    scm is offline
    Linux Engineer
    Join Date
    Feb 2005
    Posts
    1,044
    I'd have done exactly what you've done to change the hostname, so the fact that it's not working is a mystery to me. Have you got anything in /etc/hostname? If you have, and it's the old name, just delete the file and see if that resolves your problem.

  8. #8
    Just Joined!
    Join Date
    Oct 2005
    Posts
    8
    scm

    yes I know. I will contact my provider and ask them why.

    the only reason I want to change it permintally is that when I reboot the box and forget to manually change it my hostname is not a register domain so all my e-mail get returned

    If theyt give me an answer i will post it

    thanks to everybody for their sudgestions

  9. #9
    Just Joined!
    Join Date
    Oct 2006
    Posts
    1

    Changing Linux Hostname

    Guys you need to edit the following files:

    /etc/hosts

    /etc/sysconfig/network

    /etc/sysconfig/network-scripts/ifcfg-eth0 (depends on NIC name)

    then reboot.

  10. #10
    Just Joined!
    Join Date
    Jul 2007
    Posts
    3
    Your recipe worked -- but not until I rebooted. Restarting the network did not do it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...