Find the answer to your Linux question:
Results 1 to 6 of 6
Hi . I'm trying to change the hostname on my box because I'm having network troubles with machines running window's XP . seems xp defaults to "localhost " for their ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2004
    Posts
    18

    changing the hostname


    Hi . I'm trying to change the hostname on my box because I'm having network troubles with machines running window's XP . seems xp defaults to "localhost " for their hostnames too. I've used
    "hostname -v new_host_name"
    and edited the etc/hosts file to read
    "127.0.0.0 new_host_name "
    but when I reboot everything reverts to localhost except of course there is no localhost in the etc/hosts file so I get an error(warning) on boot.
    Any Ideas ??
    Thanks in advance.

  2. #2
    Linux Engineer
    Join Date
    Sep 2003
    Location
    Knoxhell, TN
    Posts
    1,078
    you have to have localhost in your /etc/hosts file.. it's the same as having both 127.0.0.1 and your LAN (local) IP address in /etc/hosts...

    to change your hostname, edit /etc/hostname
    Their code will be beautiful, even if their desks are buried in 3 feet of crap. - esr

  3. #3
    Just Joined!
    Join Date
    Nov 2004
    Posts
    18
    Thanks. If I had bothered to read some of the other posts on this site I wouldn't have had to ask the question. Sorry about that . I actually got around it by editing the netbios name in the samba.conf file . The whiney XP machines can see me now !
    Thanks again.

  4. #4
    Just Joined!
    Join Date
    Nov 2004
    Posts
    3

    Changing the host name

    You could have also edited this file:

    /etc/sysconfig/network

    There should be a line in there that says:

    HOSTNAME=whateveryourputinthere.com

    I had to change my hostname and I edited this file.

  5. #5
    Just Joined!
    Join Date
    Jul 2013
    Posts
    6
    Hello,

    I have problem in changing the hostname when I use this file : /etc/sysconfig/network, it doesn't give me the permition to save the edited file, what should I do to be able to save it?

    Thanks.

  6. #6
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,377
    This thread is very old and unlikely to continue.
    Please open your own one

    /closing
    You must always face the curtain with a bow.

Posting Permissions

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