Make host name work between Linux and Windows within LAN

Hello,

I just installed Fedora Core 8, Apache 2.2.8 and PHP 5 as well.
Everything work fine, but I have one problem.

I can access to Fedora's web server via browser by typing 192.168.21.112 through browser of Windows.

I need to access like http://fedora1 via browser of Windows.
And I configured /etc/hosts file as
127.0.0.1       localhost.localdomain   fedora1  localhost
This works only when I access via browser of Fedora.

Both computers are in same LAN and controlled by DHCP.
LAN IP ranges are 192.168.21.100 - 110.

How do I make this work?

By the way VirtualHost directive of httpd.conf configured like
ServerName fedora1
ServerAlias fedora1

Thank you.


eb110kAsked:
Who is Participating?
 
modcon_jscottConnect With a Mentor Commented:
Its pretty easy to set a static ip on linux,
ifconfig eth0 192.168.21.112 netmask 255.255.255.0 up

This is a better solution than trying to define a subnet in a hosts file, which wont work anyway.


Heres a link for linux networking: http://linux-ip.net/html/basic-changing.html
0
 
modcon_jscottCommented:
change the hosts file on your winblows machine to point fedora1 to 192.168.21.112 similar to what you did on the fedore machine.

I think this is the location on M$:
c\\windows32\drivers\etc\hosts
0
 
eb110kAuthor Commented:
Thank you for your response.
Window's hosts file must be modified in order to make this work?
I have no reason to not to modify the file, but I was wondering if there is anyway to make this work by changing something only on Fedora side.
If this is only way, I'll just give up and end this issue.

I've also tried (/etc/hosts):

127.0.0.1       localhost.localdomain   fedora1  localhost
192.168.21.100/199 localhost.localdomain fedora1 localhost

But this didn't work.
Since my LAN is DHCP, it needs to ready for assigned IP range.

I appreciate if somebody advise me.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
modcon_jscottCommented:
unless you are running a DNS server on your fedora machine which your windows machine resolves its queries through, how are you going to tell windows to look on your internal network?

The hosts file is the easiest way for you to accomplish what you want with out having to set up a FQDN or run dns and all that jazz.

Each machine will check the LOCAL hosts file to resolve IP's before trying a DNS server. If you are making a change to the fedora hosts file it will ONLY affect fedora.  The second line in your fedora hosts file is nonsense and should be removed. There is no such subnet as /199 see this link : http://en.wikipedia.org/wiki/Subnetwork

Try editing the windows hosts file and see what happens.
0
 
Duncan RoeSoftware DeveloperCommented:
It *should* be possible to configure a dhcp client (dhcpc) to tell the server what is the hostname. But... I have tried this many times and can't get it to work yet with Windows dhcp from Linux client. My home Linux LAN has static IPs so generally I've been trying it at work. At home, the Linux dhcp server does communicate Windows hostnames to the Linux dns (on same system).
I hope someone does know the answer to this - or I might have to do some serious experimenting this weekend :(or whenever I get time - could be a lot later than that)
0
 
eb110kAuthor Commented:
Thank you modcon_jscott.
It worked the way you instructed.
I was searching Yahoo and Google to  define IP address range for my DHCP on hosts file like key word "hosts file IP range DHCP", But I cannot find so far.

Is there anyway that I can define for IP range on the hosts file or I have go with static IP LAN?

Please advise.
0
 
eb110kAuthor Commented:
Thank you for your help.
0
All Courses

From novice to tech pro — start learning today.