Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi, everyone. Just want to check with u professional Linux guys about the computer name. Initially, when Linux redhat 9 is setup. The default computer name is LOCALHOST. Let say, if I want to change to LINUXTEST. What should I do?
From the DNS of networking section, I did change the localhost.localdomain -> Linuxtest.localdomain.
Then I log in to the computer again, it warns "Cannot detect localhost"...
Is there anyway I can troubleshoot this problem....besides, is there any effective way i can do with it...
Cheers~~~

You really need to have localhost as some
programs require it in order to work. You
can change your computer name by using the
hostname command or by editing /etc/
HOSTNAME. You can also edit /etc/hosts and
add as many aliases as you like, eg:127.0.0.1 localhost
192.168.0.1 linuxtest.localdomain linuxtest foobar
You can now refer to your machine as either
linuxtest.localdomain, linuxtest or foobar

Ic, so that is the way..
But when I use "vi /etc/hosts"...
i couldn't add anything inside ...I can add then i type ":wq!"...it seem dun works ...ioi
is there anyway i can edit it as mentioned as previous reply...
Many thanks!

vi has insert mode & command mode. Press 'i' to enter insert mode & start editing, press <Esc> to enter command mode & enter commands like 'q'.

If you are just starting out, try something
like mcedit if you have it installed, it's
a little like DOS edit and easy to use.
As 99% of linux configuration is done with
text files, I would strongly recommend
getting used to vi or my preference emacs.
You will also have to be root in order to
edit those files.

Alright...ic,
let say my IP address on the network is 192.168.10.82...
After open /etc/hosts it shows
127.0.0.1 localhost
Then, i add
192.168.10.82 linuxtest
and did wat i need to do which is successful(in editing)
is this mean the computer name of the computer i'm using is changed to LINUXTEST?
However, I can't see my computer name in the workgroup i set from the smb:///.From the Win user, I also can't see anything appear in the same workgroup... ioi
If I hav other computer's IP with Linux set is 192.168.10.108...
I add
192.108.10.108 LINUXTEST2
in the /etc/hosts
Is it useful in viewing the shared file, however, nothing appear too ioi
Any suggestions by professional Linux ppl ^0^?
Cheers~~~

The hosts file is referred to when trying
to resolve names. If it finds one it should
then translate it to the IP....so pinging
linuxtest should work. You would probably
want to add "192.168.10.108 linuxtest2" to
the file as well...in fact add all your
computers to it (including the windoze one)
and make sure that the file is the same on
each PC.
The samba name (ie for smb://linuxtest to
work) needs to be set in the samba config
file (/etc/samba/smb.conf) as well as the
workgroup name, share names etc. You also
have to make sure that the samba service is
running and you will have to restart it to
make the changes work. Either "service smb
restart" or "/etc/init.d/smbd restart"
should work.
In order for users to be able to view files
via samba, they have to be added to the
samba users database with "smbpasswd -a
username"

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |