LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Ping: unknown (local) host, FC-12, w/ router & DSL modem, not newbie, but stumped. (https://www.linuxquestions.org/questions/linux-networking-3/ping-unknown-local-host-fc-12-w-router-and-dsl-modem-not-newbie-but-stumped-795914/)

Al Schapira 03-16-2010 09:34 PM

Ping: unknown (local) host, FC-12, w/ router & DSL modem, not newbie, but stumped.
 
Please pardon the length of this plea for help, but I want to lay out all the info I think is relevant.

Three PCs are connected to a Linksys WRT54GL router (no wireless involved here.)
The router is addressed as 192.168.2.1 and provides DHCP to the PCs.

The router is connected to a Westell Verizon DSL modem.
The modem is addressed as 192.168.1.1 and provides DHCP to the router
(192.168.1.45)

All three PCs connect to external internet properly.
The router's DHCP client table shows all three PCs by name with their
assigned address, typically those in the table below.

PROBLEM:
The two FC-12 PCs CANNOT ping the others BY NAME but CAN ping BY ADDRESS.
Also the FC-12 PCs that can ping by address but not by name can also ssh, etc by address, but not by name.

The FC-12 PCs CAN ping external servers such as google.com, yahoo.com, properly.

The W-XP PC, however, CAN ping the FC-12 PCs by name, e.g from "A" I can ping "B" and "C".

BUT:
The FC-12 PCs CAN see the other PCs using the 'network places' Gnome GUI, and CAN copy files among them using drag-and-drop. !!!

ALSO:
Addressing the PCs by name used to work when I had AT&T DSL service, but something changed when the router was configured for Verizon DSL service. Previously, the router was set to PPPOE, and I used static addresses on all PC's, now its set to DHCP, as per Verizon. I removed the static addresses from /etc/hosts on the FC-12 PCs.

Also, from the W-XP side, the FC-12 SMB clients seem to work properly.

Here is the situation:
------------------------------------------------------------------------------------
Code:

PC  OS    typical  DHCP  can ping  can ping  can ping  can ping  can ping  can ping
                IP      ... .110      A    ... .111      B    ... .112    C
==  =====  =============  ========  ========  ========  ======== ========  ========
A  W-XP  192.168.2.110    yes      yes      yes      yes      yes      yes 
B  FC-12  192.168.2.111    yes      no        yes      no      yes      no 
C  FC-12  192.168.2.112    yes      no        yes      no      yes      no


Code:

[B]$ ping 192.168.2.110    {B pinging A by address}
PING 192.168.2.110 (192.168.2.110) 56(84) bytes of data.
64 bytes from 192.168.2.110: icmp_seq=1 ttl=128 time=0.287 ms
64 bytes from 192.168.2.110: icmp_seq=2 ttl=128 time=0.276 ms
64 bytes from 192.168.2.110: icmp_seq=3 ttl=128 time=0.292 ms
^C
--- 192.168.2.110 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2334ms
rtt min/avg/max/mdev = 0.276/0.285/0.292/0.006 ms

[B]$ ping A                {B pinging A by name}
ping: unknown host A

-----------------------------------------------------------------------------------
[B]$ cat /etc/resolv.conf  { same on C }
; generated by /sbin/dhclient-script
search GAMMA5
nameserver 192.168.2.1    { the router }
nameserver 192.168.1.1    { the DSL modem }
-----------------------------------------------------------------------------------

From C: { or B }
[C]$ ping -c2 google.com
PING google.com (66.249.81.104) 56(84) bytes of data.
64 bytes from lga15s01-in-f104.1e100.net (66.249.81.104): icmp_seq=1 ttl=47 time=27.8 ms
64 bytes from lga15s01-in-f104.1e100.net (66.249.81.104): icmp_seq=2 ttl=47 time=28.0 ms

--- google.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1029ms
rtt min/avg/max/mdev = 27.857/27.955/28.053/0.098 ms

========================================================================
Since the W-XP box can ping the others by name I conclude:
1) nothing is blocking ping protocols.
2) there is a DNS server working in the router (or somewhere else)

What do I have to do in the FC-12 PC's to get name resolution for the other PC's?
Which daemons should be running on the FC-12 boxes?
Which should NOT be running on the FC-12 boxes?
What do I check in iptables etc to make sure this is not the problem?

Thanks for any suggestions to fix this problem.

-Al

oznola 03-16-2010 10:10 PM

perhaps try <hostname>.localdomain for the ping.

nimnull22 03-16-2010 10:28 PM

To be able to ping by host name, you need to state host name in DHSP request file of each host.
So when host asks for IP it also gives your router/DHSP server its host name.
Then you should state in DHCP server that DNS server is your router, and in router settings state external DNS server. In that case computers will ask your router and it give them IP of other hosts in its LAN.

Hope you understand me.

michaelk 03-17-2010 01:54 AM

Windows computers use netbios for hostname to IP address lookup but linux normally does not. The fact that windows computers can use the linux hostname instead of the IP address is due to samba which is why windows can ping a linux computer by hostname but not the opposite. Gnome and other file browsers have built in SMB (netbios) client support which is why it works like network neighborhood.

The reason it worked before is because the hostname to IP address lookup was being accomplished by the hosts files but since you are using DHCP now it will not work. You can configure linux to use "netbios" for hostname IP address lookup via wins. I've posted a couple of URLs that will help you get it working. I assume that samba is compiled with libnns_wins support.

http://samba.org/samba/docs/man/Samb...html#id2668215
http://www.linuxquestions.org/questi...d-wins-608694/

Al Schapira 03-18-2010 11:49 AM

That did it!
 
Thank you michaelk. I added 'wins' to the end of the 'hosts' line in nsswitch.conf (on both linux boxes) and voila! I can ping by name all PCs from all PCs. --Al


All times are GMT -5. The time now is 07:28 PM.