Networking Forums

Networking Forums > Computer Networking > Linux Networking > hostname not visible when Linux PC receives IP from router DHCP

Reply
Thread Tools Display Modes

hostname not visible when Linux PC receives IP from router DHCP

 
 
tek
Guest
Posts: n/a

 
      11-13-2007, 04:35 AM
My Linksys router acts as the DHCP server for my LAN. I have 4 Windows
XP Home PCs and 1 Linux (FC7) PC connected to the router. Each PC
receives its IP from the router. Each PC can ping each others IP
address. Each PC can connect to the internet. Each PC can see each
other through the Windows Network Places. One of the WIndows PCs is
the Workgroup Master (which holds the hostname browse list). I did not
designate the Linux PC to perform this function because the PC is not
always connected to the LAN.

There is just one problem. On any Windows PC I can ping by the
hostname the other Windows PCs including the Linux PC. None of the
hostname/IP address associations are in the hosts files. Each hosts
file on the Windows PCs looks like this:

127.0.0.1 localhost.localdomain localhost
192.168.0.10 hplp # HP Printer
192.168.0.1 lansys1 # Linksys Router

The Linux PC contains the same lines. However, I'm unable to ping any
the Windows PCs by hostname. I can't add the hostnames and IPs to the
Linux hosts file because if the DHCP server decides to change the IP
of a PC then it makes the Linux hosts file wrong.

Why is Windows able to ping by hostname and not Linux?

 
Reply With Quote
 
 
 
 
tek
Guest
Posts: n/a

 
      11-13-2007, 08:07 PM
On Nov 13, 12:35 am, tek <kevind...@yahoo.com> wrote:
> My Linksys router acts as the DHCP server for my LAN. I have 4 Windows
> XP Home PCs and 1 Linux (FC7) PC connected to the router. Each PC
> receives its IP from the router. Each PC can ping each others IP
> address. Each PC can connect to the internet. Each PC can see each
> other through the Windows Network Places. One of the WIndows PCs is
> the Workgroup Master (which holds the hostname browse list). I did not
> designate the Linux PC to perform this function because the PC is not
> always connected to the LAN.
>
> There is just one problem. On any Windows PC I can ping by the
> hostname the other Windows PCs including the Linux PC. None of the
> hostname/IP address associations are in the hosts files. Each hosts
> file on the Windows PCs looks like this:
>
> 127.0.0.1 localhost.localdomain localhost
> 192.168.0.10 hplp # HP Printer
> 192.168.0.1 lansys1 # Linksys Router
>
> The Linux PC contains the same lines. However, I'm unable to ping any
> the Windows PCs by hostname. I can't add the hostnames and IPs to the
> Linux hosts file because if the DHCP server decides to change the IP
> of a PC then it makes the Linux hosts file wrong.
>
> Why is Windows able to ping by hostname and not Linux?



I found that answer is to add "wins" as a lookup parameter to the
"hosts:" line in the /etc/nsswitch.conf file.



 
Reply With Quote
 
Ashish Shukla आशीष शुक्ल
Guest
Posts: n/a

 
      11-13-2007, 08:07 PM
,--- tek writes:
| My Linksys router acts as the DHCP server for my LAN. I have 4 Windows
| XP Home PCs and 1 Linux (FC7) PC connected to the router. Each PC
| receives its IP from the router. Each PC can ping each others IP
| address. Each PC can connect to the internet. Each PC can see each
| other through the Windows Network Places. One of the WIndows PCs is
| the Workgroup Master (which holds the hostname browse list). I did not
| designate the Linux PC to perform this function because the PC is not
| always connected to the LAN.

| There is just one problem. On any Windows PC I can ping by the
| hostname the other Windows PCs including the Linux PC. None of the
| hostname/IP address associations are in the hosts files. Each hosts
| file on the Windows PCs looks like this:

| 127.0.0.1 localhost.localdomain localhost
| 192.168.0.10 hplp # HP Printer
| 192.168.0.1 lansys1 # Linksys Router

| The Linux PC contains the same lines. However, I'm unable to ping any
| the Windows PCs by hostname. I can't add the hostnames and IPs to the
| Linux hosts file because if the DHCP server decides to change the IP
| of a PC then it makes the Linux hosts file wrong.

| Why is Windows able to ping by hostname and not Linux?

Windows also uses NETBIOS to resolve names, whereas Linux doesn't do
this by default (in most of the distros). But I'm not able to explain
why your Windows Box able to 'resolve' Linux box with hostname. Are
you sure your Linux box is not using DNS server than the Linksys
router.

HTH
--
Ashish Shukla आशीष शुक्ल http://wahjava.wordpress.com/
·-- ·- ···· ·--- ·- ···- ·- ·--·-· --· -- ·- ·· ·-·· ·-·-·- -·-· --- --
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows Server 2008 DHCP Reservations not visible from 2003 DHCP mmc Ckuderna Windows Networking 2 04-02-2009 01:47 PM
Router cannot get hostname of Linux client PC Daniel =?ISO-8859-1?Q?B=F6hmer?= Linux Networking 3 03-07-2006 08:55 AM
Linux to Wireless Router - Client Hostname Problem johnebullock@hotmail.com Linux Networking 0 04-15-2005 06:19 PM
Assign Windows hostname via DHCP (linux)? Pandabaer Linux Networking 1 06-07-2004 01:41 AM
Linux host name visible to Windows boxes Gary N. Linux Networking 2 07-02-2003 01:37 AM



1 2 3 4 5 6 7 8 9 10 11