Click to See Complete Forum and Search --> : Hostname doesn't seem to work
frank b
10-28-2002, 06:17 PM
Well I wanted to give my Linux machine a hostname just on the LAN but all my efforts don't seem to work. Maybe I just don't know what hostname really is.
For instance when I ping other computers on the network from my windows machine using
ping -a X.X.X.X
It will resolve the name without a problem. When I try to ping my Linux box it doesn't resolve the name and just shows the IP address I have assisnged it.
I checked and modified /etc/hosts, /etc/sysconfig/hosts, and /etc/hostname and to no avail.
I'm using Red Hat 7.3 and I only want the name of the machine to be F.
mychl
10-28-2002, 07:00 PM
Take a look at /etc/sysconfig/network
frank b
10-28-2002, 07:08 PM
/etc/sysconfig/network says:
Networking=Yes
Hostname=F
Gateway=192.168.1.1
cowanrl
10-28-2002, 07:17 PM
Are you saying you just want to be able to execute:
ping f
from your Windows machine and it will resolve f to your Linux machine's IP address and execute the ping?
deanjavu
10-28-2002, 07:20 PM
name resolution can be done in 2 ways: a name server or hosts files. If you have a name server, add name records for your local machines. If you don't, hmmm, add records of your machines in each machine's hosts file. My recommendation? setup a DNS or name server.
frank b
10-28-2002, 10:18 PM
Originally posted by cowanrl
Are you saying you just want to be able to execute:
ping f
from your Windows machine and it will resolve f to your Linux machine's IP address and execute the ping?
Yeah that's what I wanted it to do. I don't have a nameserver or anything so I guess I'm out of luck. I was wanting to run a webpage that was only available on a LAN and have the url be http://F but that's probably outside the realm of possibility.
Thanks,
Frank
cowanrl
10-28-2002, 10:34 PM
Originally posted by frank b
Yeah that's what I wanted it to do. I don't have a nameserver or anything so I guess I'm out of luck. I was wanting to run a webpage that was only available on a LAN and have the url be http://F but that's probably outside the realm of possibility.
Thanks,
Frank
It shouldn't be out of the realm of possibility. If you have just a small lan, you can make entries in each computers hosts file as deanjavu said. On NT class machines, the hosts file is in:
\winnt\system32\drivers\etc
On Win9x machines, I believe it's in the :
\windows
directory. The format of the hosts file on Windows is the same as in Linux. You would need a line that said:
xx.xx.xx.xx F f
Where xx.xx.xx.xx is the IP address of your server. Use both an upper and lower case F to make up for user inconsistency.
Once you created the hosts file, you could just copy it to the proper location on all of your workstations.
With that, you're users could just enter:
http://f
to access your server.
If you have a large network, then a DNS server would be more practical.
frank b
10-28-2002, 10:41 PM
Wow that was a quick reply. I wouldn't consider my network to be large by any means. I'll give this a shot but maybe I should look further into a nameserver.
Thanks
mychl
10-29-2002, 02:50 AM
You can use samba to be a name server as well as give your machine the netbios name of F
reallynicejerk
10-29-2002, 03:39 AM
Originally posted by frank b
I don't have a nameserver or anything so I guess I'm out of luck.
it shouldn't be that hard to set up a nameserver on your machine, you don't need a seperate machine for it or anything.
cowanrl
10-29-2002, 08:43 AM
If you're looking for some help in setting up a DNS server on a small or home network, look at this post:
http://www.linuxnewbie.org/forum/showthread.php?s=&threadid=69670