Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Cannot ping machines in LAN by name
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
eyebex
n00b
n00b


Joined: 23 Jul 2005
Posts: 65

PostPosted: Sun Feb 03, 2008 9:47 pm    Post subject: [SOLVED] Cannot ping machines in LAN by name Reply with quote

Hi,

I'm having trouble setting up the name resolution in my mixed Gentoo / Windows LAN. I have a PC "passau" running Windows, as well as a server "udat" and notebook "porto" which both run Gentoo. According to my router all get IPs assigned and have their hostnames properly set. Everyone can ping everyone else fine using IPs.

But using hostnames, only "passau" can ping "udat" (but not "porto"). On the other hand, "udat" cannot ping "passau" (ping: unknown host passau). Here's udat's setup:

/etc/conf.d/hostname (added to "boot" runlevel):
HOSTNAME="udat"


/etc/conf.d/net:
config_eth0=( "dhcp" )
dhcp_eth0="nontp nonis"
dhcpcd_eth0="-t 20"


/etc/resolv.conf:
# Generated by dhcpcd for interface eth0
nameserver 192.168.1.1


"porto" has the same configuration as "udat" and also cannot ping any other machine on the LAN by name. Any hint what's wrong?

BTW: Which man page do I need to look at for the options that can go into "/etc/conf.d/net"?

Thanks.


Last edited by eyebex on Mon Feb 04, 2008 12:54 am; edited 2 times in total
Back to top
View user's profile Send private message
nobspangle
Veteran
Veteran


Joined: 23 Mar 2004
Posts: 1318
Location: Manchester, UK

PostPosted: Sun Feb 03, 2008 9:54 pm    Post subject: Reply with quote

I'm guessing your server has samba installed and running but your laptop doesn't.

If you want to ping all the machines by hostname you need to setup your gentoo boxes to use wins for name resolution, or enter IP addresses into the host files. Or setup a nameserver that supports dynamic updating.
Back to top
View user's profile Send private message
eyebex
n00b
n00b


Joined: 23 Jul 2005
Posts: 65

PostPosted: Sun Feb 03, 2008 10:19 pm    Post subject: Reply with quote

nobspangle wrote:
I'm guessing your server has samba installed and running but your laptop doesn't.

Sorry for omitting that piece of information: Both the server and laptop have samba installed.

nobspangle wrote:
If you want to ping all the machines by hostname you need to setup your gentoo boxes to use wins for name resolution,

Thanks for the hint. I've followed the instructions at http://www.gentoo.org/doc/en/articles/samba-p2.xml to enable WINS support for the samba installation on my server, but that did not help.

Supposing I would not have samba installed, would there be no way to ping Windows PCs by name in a LAN from such a machine?

nobspangle wrote:
or enter IP addresses into the host files. Or setup a nameserver that supports dynamic updating.

Hard-coding the IPs into the hosts file is not an option for me. I'm a little confused because I was pretty sure my current nameserver (in my router) supports WINS ... at least it shows the proper names in its web configuration.

EDIT: I may add that "smbclient -L passau" works from my server, while "ping passau" does not.

EDIT2: Thinking about it, it cannot be related (solely) to WINS, as I also cannot ping my server from my laptop by name, and both are running Gentoo and have their hostnames set up properly.
Back to top
View user's profile Send private message
eyebex
n00b
n00b


Joined: 23 Jul 2005
Posts: 65

PostPosted: Mon Feb 04, 2008 12:00 am    Post subject: Reply with quote

I found the solution on this page:
http://us1.samba.org/samba/docs/man/Samba-HOWTO-Collection/integrate-ms-networks.html#id433004

Quote:
Starting with version 2.2.0, Samba has Linux support for extensions to the name service switch infrastructure so Linux clients will be able to obtain resolution of MS Windows NetBIOS names to IP addresses. To gain this functionality, Samba needs to be compiled with appropriate arguments to the make command (i.e., make nsswitch/libnss_wins.so). The resulting library should then be installed in the /lib directory, and the wins parameter needs to be added to the “hosts:” line in the /etc/nsswitch.conf file. At this point, it will be possible to ping any MS Windows machine by its NetBIOS machine name, as long as that machine is within the workgroup to which both the Samba machine and the MS Windows machine belong.

So what I did was:
1) Editing /etc/nsswitch.conf as described.
2) Re-emerging samba with the "winbind" USE flag.
3) Restarting samba.

After that, I was able to ping all my machines in my LAN by name.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum