Find the answer to your Linux question:
Results 1 to 5 of 5
Hi everyone, I'm new to the linux world and I've been using Mandrake 10.1 for a few days now. I just have one quick question (out of the many I ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux User
    Join Date
    Mar 2005
    Location
    CA
    Posts
    352

    Changing Hostname


    Hi everyone,

    I'm new to the linux world and I've been using Mandrake 10.1 for a few days now. I just have one quick question (out of the many I have for maybe later) about how to change my hostname. Probably a simple question that I should be able to answer myself, but I haven't been able to figure it out yet. Any help would be appreciated. Thanks!

  2. #2
    Just Joined!
    Join Date
    Mar 2005
    Location
    Northern Ireland
    Posts
    23
    Try hostname <whatever> as root user:

    Code:
    $
    $ hostname
    localhost
    $
    $ su -
    
    # hostname myhost
    # hostname
    myhost
    #

  3. #3
    Linux User
    Join Date
    Mar 2005
    Location
    CA
    Posts
    352
    Thanks for the reply dtodd. Heh, I knew it should have been something as easy as that...

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Dec 2004
    Posts
    16

    Hostname

    I tried that and it didn't work on my 10.1 system

  6. #5
    Linux User
    Join Date
    Mar 2005
    Location
    CA
    Posts
    352
    That's odd. I did find something else and I have read some other posts about changing the hostname. You could try editing the network file:
    Code:
    $  su
    type password
    #  cd /etc/sysconfig
    #  vi network
    Then once in the network file, press "a" (to be able to insert something) and add the line HOSTNAME="your_hostname". Once that's done, press escape so you are unable to insert anything else and then enter this in on your keyboard :wq (make sure you get the colon in). Restart your PC and, cross your fingers, the hostname should be changed...


    Hope this helps.

Posting Permissions

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