Find the answer to your Linux question:
Results 1 to 9 of 9
how do i permenantly change the hostname of my computer, i did 'HOSTNAME blabla' in the console but it changed back as soon as i restarted the computer, how can ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    Feb 2003
    Location
    Swansea (UK)
    Posts
    221

    Permenant hostname change


    how do i permenantly change the hostname of my computer, i did 'HOSTNAME blabla' in the console but it changed back as soon as i restarted the computer, how can i change it forever?

  2. #2
    Linux Newbie
    Join Date
    Mar 2003
    Location
    Istanbul/Türkiye
    Posts
    246
    edit the files

    /etc/hosts and
    /etc/sysconfig/network
    Just a Newbie....Looking 4 Info....

  3. #3
    Linux Newbie
    Join Date
    Feb 2003
    Location
    Swansea (UK)
    Posts
    221
    Quote Originally Posted by heartsmagic
    edit the files

    /etc/hosts and
    /etc/sysconfig/network
    what lines of these do i edit, i am a bit causious about editing system files, dont wanna mess anything up?

  4. #4
    Linux Newbie
    Join Date
    Mar 2003
    Location
    Istanbul/Türkiye
    Posts
    246
    ok if you want to do it a little bit safely
    first do

    cp /etc/hosts /etc/hosts.bak and
    cp /etc/sysconfig/network /etc/sysconfig/network so you ll backup the files and if something goes wrong you can use those files

    then edit the files but dont be afraid of doing that because you ll edit only one line..
    Just a Newbie....Looking 4 Info....

  5. #5
    Linux Newbie
    Join Date
    Feb 2003
    Location
    Swansea (UK)
    Posts
    221
    /etc/sysconfig/network

    NETWORKING=yes
    HOSTNAME=localhost.localdomain

    /etc/hosts

    # Do not remove the following line, or various programs
    # that require network functionality will fail.
    127.0.0.1 localhost.localdomain localhost

    if i change the hostname line on ./sysconfig/network will it change my hostname? i dont want to cause any problems here... dont i have to change localhost.localdomain first?

  6. #6
    Linux Newbie
    Join Date
    Mar 2003
    Location
    Istanbul/Türkiye
    Posts
    246
    oops Sorry it was /etc/HOSTNAME

    instead of /etc/hosts sorry
    Just a Newbie....Looking 4 Info....

  7. #7
    Linux Newbie
    Join Date
    Feb 2003
    Location
    Swansea (UK)
    Posts
    221
    Quote Originally Posted by heartsmagic
    oops Sorry it was /etc/HOSTNAME

    instead of /etc/hosts sorry
    i dont have /etc/HOSTNAME

  8. #8
    Linux Newbie
    Join Date
    Mar 2003
    Location
    Istanbul/Türkiye
    Posts
    246
    Distro?

    Ok then just edit "localhost.localdomain" section what name you want and reboot your machine.
    Just a Newbie....Looking 4 Info....

  9. #9
    Linux Newbie
    Join Date
    Feb 2003
    Location
    Swansea (UK)
    Posts
    221
    i'vw got redhat linux 8.0

    Edit: ok thanks, i've done it now

Posting Permissions

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