Find the answer to your Linux question:
Results 1 to 8 of 8
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    Jan 2005
    Location
    Pennsylvania
    Posts
    116

    computer name is localhost


    When i installed FC3 a while back, it named my machine localhost and it's causing problems with samba. How the heck to i change the computer's name to something else at this point in the game and do i have to change it in more than one config file?
    Register Linux User #388393
    _________________________________________

  2. #2
    Just Joined!
    Join Date
    Feb 2004
    Location
    Indonesia
    Posts
    84
    #vi /etc/sysconfig/network

    #### change localhost to whatever you like ########
    #####################################

    HOSTNAME=srv.myserver.com ---> is a good choice

    :wq
    #shutdown -r now (i always to reset server to change host name any ideas to stop this bad habit)


    hope this help

  3. #3
    Linux Newbie
    Join Date
    Jan 2005
    Location
    Pennsylvania
    Posts
    116
    Thanks, but that seems to have opened up a whole new can of worms.
    I made the change from localhost.localdomain to fedora.localdomain and rebooted the machined. Now after i login, it says:

    "Could not look up internet address for fedora.localdomain. This will prevent GNOME from oeprating correctly. It may be possible to correct the problem by adding fedora.localdomain to the file /etc/hosts."
    Register Linux User #388393
    _________________________________________

  4. $spacer_open
    $spacer_close
  5. #4
    I had the same problem - read that error message again - it gives you a pretty good hint on how to resolve the problem. In your /etc/hosts file there is a line that will read "localhost.localdomain 127.0.0.1" Simply replace that localhost.localdomain with what your new computer name is and leave the 127.0.0.1. Make sure the name matches what you entered in /etc/sysconfig/network or you'll get the same message next time you reboot.

  6. #5
    Quote Originally Posted by carbon8
    Thanks, but that seems to have opened up a whole new can of worms.
    I made the change from localhost.localdomain to fedora.localdomain and rebooted the machined. Now after i login, it says:

    "Could not look up internet address for fedora.localdomain. This will prevent GNOME from oeprating correctly. It may be possible to correct the problem by adding fedora.localdomain to the file /etc/hosts."
    Yeap. Just edit your /etc/hosts to the following, example u want ur server to be named is fedora

    127.0.0.1 fedora.localdomain fedora

    this way, the Linux OS will be able to resolve the hostname-to-ip upon system loading through reading your /etc/hosts

  7. #6
    Be aware that there may be programs that will require localhost to be resolvable. You'd be better giving your system a static IP address instead of messing with the localhost line:
    Code:
    192.168.1.1   fedora.localdomain  fedora

  8. #7
    Quote Originally Posted by kamtono
    #shutdown -r now (i always to reset server to change host name any ideas to stop this bad habit)
    The hostname(1) command should change it without requiring a reboot. Also, "service network restart" may well do the trick. Rebooting is the last resort with Linux, and the first resort with Windoze!

  9. #8
    Quote Originally Posted by scm
    Be aware that there may be programs that will require localhost to be resolvable. You'd be better giving your system a static IP address instead of messing with the localhost line:

    Hey thanks for that tip - I was not aware of that - being a newbie and all.

Posting Permissions

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