Click to See Complete Forum and Search --> : System name on the network
Hondaman900
11-24-2002, 03:21 AM
By default my system is named "localhost" and this is how it is named/appears on my network (through Samba) when viewed on other (Win) systems. How do I change this name to anther name? I cannot find an identification setting for the system in Gnome and the many listed utilities. This name is a particular problem as I cannot see the system's home page by typing in http://localhost in the browser of another system on my network, as this clashes with that system's own Web server.
Your help is most appreciated.
orangedi
11-24-2002, 03:52 AM
there is a file named /etc/hostname, also look at /etc/hosts you may want to add your new hostname there as well.
Hondaman900
11-26-2002, 12:49 AM
I changed the hostname in these files and now the system will only boot to the login text prompt. What ahve I done wrong here?
Help!
orangedi
11-26-2002, 02:00 AM
make sure your etc/hosts still has the loopback and localhost files.
127.0.0.1 localhost.localdomain localhost [yourhost]
and the only thing in etc/hostname should be your host name.
Hondaman900
11-26-2002, 12:31 PM
So, if I'm clear, I shouldn't change the existing content of the etc/hosts file, just add to it. So if I wanted my hostname to be "linuxhost" I should have the following in etc/hosts:
127.0.0.1 localhost.localdomain localhost linuxhost
and, again if I understand correctly, I must add "linuxhost" to the etc/hostname file?
Please confirm, and many thanks for the help.
Stephen
BTW, I got the GUI back by reversing the changes I had made to etc/host
jakedakat
11-26-2002, 10:37 PM
What exactly is the host name? Is it a Netbios(Computer)name or is it more Like a Domain name in a W2K domain? And does it matter what I name my linux box? I am using it as a Router and firewall and print server. And I guess I would have to implement dns on my Lan or could I just use lmhost file? Sort of the same subject so I figured I would post it here.
Rob
Hondaman900
11-27-2002, 12:23 PM
The name that appears on the network is my issue. I have changed the server name in the etc/host file (so that now http://localhost doesn't work, it must be http://linuxhost which is the new name), and I have set the Samba name for the box, but the name "localhost" persists.
On my LAN I see the system listed as Localhost, and in detail form, as "Sambaserver (localhost)", where Sambaserver is the name assigned in the Samba config file. When RedHat boots up, I can see localhost.localdomain coming up in the login texts.
Anyone know how I can change this, It's driving me nuts. Until I change the name from localhost my Win systems cannot link to it as that name conflicts with IIS.
Help!
orangedi
11-27-2002, 08:04 PM
so if i understand now you have set your hostname as indicated to linuxhost and this appears when you type hostname at the bash prompt. now you have the problem that this is not the name that appears on the network.
try editing smb.conf so the first three lines in [global] state as such
[global]
workgroup = (your network name)
netbios name = linuxhost
server string = (anything you want)
do this manually as i don't know if swat lets you. or, try it in SWAT. it might.
BTW localhost should still always work. that might become an issue at some point.
bastard23
11-27-2002, 10:20 PM
Hondaman900,
orangedi is correct for the Samba side. Once it is set, you should see that name when browsing from windows. On the unix side, here is the proper format for you /etc/hosts file:
127.0.0.1 localhost.localdomain localhost
<your IP address> linuxhost
Hopefully that will get http://localhost working again. BTW the localhost name has become a TCP/IP standard to resolve to the local machine. That is why on you windows machine, it gives you the local web server.
jakedakat,
The hostname in unix is a little different than the windows stuff. Windows publishes the hostname, unix doesn't. Unix relies on other means to resolve network hostnames (/etc/hosts, DNS, NIS, and I'm sure there are others.) The actual hostname in unix isn't too important, but you what to be consistent so you don't confuse yourself.
Hope that helps,
chris
Hondaman900
11-28-2002, 01:04 AM
Many thanks Chris and orangedi,
Since my Linux system uses DNS to fetch an IP address from my router, how can I specify the IP address in the /etc/hosts file? Won't it change when I reboot and therefore no longer match the /etc/hosts file entry?
Your thoughts?
I'll check out your recommendations when I get home from work (where my Linux system is located) and report back.
Hondaman900
11-28-2002, 03:28 AM
Seems like I'm getting nowhere.
I did the two things suggested. I added
netbios name = linuxhost
to the smb.cnfg file, and added
192.168.2.101 linuxhost
to my /etc/hosts file, as this is the assigned IP address on my LAN provided by my router's DHCP.
Still getting localhost showing as the system name on my LAN. The changes to the /etc/hosts file did, however, restore the http://localhost pointer to Apache on the Linux system itself, which is good.
There must be a setting somewhere that can change this name, don't you think?
Another anomaly is that http://localhost:901 doesn't give meSWAT, but sends me to the Netscape Web search engine.
Hondaman900
11-28-2002, 03:49 AM
Update with success!
In the changes I left out "localhost" at the end of the line
127.0.0.1 localhost.localdomain localhost
in /etc/hosts when making the changes. Fixing that cleared up the issue. For a moment there were two Linux systems on my LAN, a localhost and a linuxhost, but after a reboot o the Linux box, it resolved to just linuxhost.
Now the error message about the conflicting name is gone, just an error saying that it's not accessible and that I don't have permissions to use it. I now have to figure out how to add a login prompt to the LAN connection so that I can authenticate and connect from my Win systems.
However, the browser route to SWAT is still not working. Anyone know of another way to get there?
Getting there...
Thanks for all the help folks