What's in a name?
How do you change the name of your computer?
(i.e. From "localhost" to "flagship") or at least get it to call up the server when you type http://flagship in stead of having to type http://localhost This way I can link to my linux machine by name |
quick and dirty: update /etc/hosts or /etc/hostname to the name you want
|
there is also the
Code:
hostname Code:
hostname new-hostname-here |
wasn't sure about the syntax so i stuck to the editing of the file. that method will work, but edit the file if you want, just so that it is permanent :p
|
I tried useing the "hostname name_I_wanted" command. it didnt spit out an error or anything so I thought it took but nothing changed. even after a reboot it's still localhost.
I looked in /etc but did not see a hostname file, do I have to create it? in my /etc/rc.sysinit file, I saw this ... HOSTNAME='/bin/hostname' <snip> if [ -z "$HOSTNAME" -o "$HOSTNAME" = "(none)" ]; then HOSTNAME=localhost does that mean I should edit /bin/hostname and not /etc/hostname? it looks like some kind of script. if I create a /etc/hostname file, do I just put a line with my desired name in it? or name= or what? in my /etc/hosts , I have ... 127.0.0.1 localhost do I just change local host to the name I want? Hey, so I'm a newb and have lots of questions so thanks for your answers. dworkin |
Quote:
127.0.0.1 flagship You might also be able to change the first line to read: 127.0.0.1 localhost flagship |
If you don't have an /etc/hostname already, create a world readable plain text file with the name of the system as the only contents. Then edit your /etc/hosts file. My localhost entry looks like this ("baron" is the hostname):
Code:
127.0.0.1 localhost baron Håkan |
Thanks, much apreciated!
|
All times are GMT -5. The time now is 11:38 AM. |