Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Ping windows machines by name
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
d4mo
Guru
Guru


Joined: 27 Jun 2005
Posts: 430

PostPosted: Thu May 21, 2009 1:36 pm    Post subject: Ping windows machines by name Reply with quote

So I've tried to look online and can't find a staightforward answer. Is it NetBIOS that does it? If I understand correctly NetBIOS is a part of CIFS? Or is that incorrect?

Also if it is NetBIOS that does it, is there anyything I can install to get just the Naming support. I don't want to install samba just for that.
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23100

PostPosted: Thu May 21, 2009 2:04 pm    Post subject: Reply with quote

As far as I know, WINS is the reason Windows machines can find hosts that have not been given proper DNS entries. Once WINS finds the name, the ping is done in the same way as if you entered the IP address explicitly, got the name from DNS, or had it in your /etc/hosts file. If you are dealing with a small number of statically addressed Windows machines, I would just put their names in /etc/hosts and call it done. If you have a large site, or if the machines change addresses, you will need to get a WINS resolver. I think net-fs/samba has such a resolver, but I do not use it. See man winbindd (yes, two Ds) for details. I think that you could run just winbindd without also providing full CIFS server, but I have never tried that, either.
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10733
Location: Somewhere over Atlanta, Georgia

PostPosted: Thu May 21, 2009 2:32 pm    Post subject: Reply with quote

I have yet to see a crappy little (i.e., home) router DHCP / DNS service that correctly provides name service for local machines but dnsmasq and bind both do. My advice would be to install dnsmasq on an appropriate machine and set it up to provide DNS and DHCP for your network. Of course, you'll have to disable those services in your home router.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
szczerb
Veteran
Veteran


Joined: 24 Feb 2007
Posts: 1709
Location: Poland => Lodz

PostPosted: Thu May 21, 2009 2:53 pm    Post subject: Reply with quote

john_r_graham wrote:
I have yet to see a crappy little (i.e., home) router DHCP / DNS service that correctly provides name service for local machines but dnsmasq and bind both do.
Any router capable of running openWRT, tomato, DD-WRT can do that. That's almost every linksys WRT, some Asus, some Buffalo, some of some other companies ;] They are small, home and almost cheap (my Asus WL500gP v1 (with the wifi card on miniPCI and 2 USB 2.0 ports) costs about 70 Euros and those linksys WRTs are usually significantly cheaper).
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10733
Location: Somewhere over Atlanta, Georgia

PostPosted: Thu May 21, 2009 3:03 pm    Post subject: Reply with quote

Right you are. Here's a clarification: I have yet to see a crappy little (i.e., home) router DHCP / DNS service that out of the box correctly provides name service for local machines. I still recommend dnsmasq. :P

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
szczerb
Veteran
Veteran


Joined: 24 Feb 2007
Posts: 1709
Location: Poland => Lodz

PostPosted: Thu May 21, 2009 4:25 pm    Post subject: Reply with quote

DD-WRT uses dnsmasq and the others also if I remember correctly :) So basically it's the way to go ;] Although once I had an ambition to set up local bind and caching and with reading dhcpd leases...
Back to top
View user's profile Send private message
d4mo
Guru
Guru


Joined: 27 Jun 2005
Posts: 430

PostPosted: Thu May 21, 2009 5:00 pm    Post subject: Reply with quote

ok that may work(I've been using ddwrt for years). But it won't work for the Windows PC's to be able to ping the linux box by hostname....right?
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10733
Location: Somewhere over Atlanta, Georgia

PostPosted: Thu May 21, 2009 6:13 pm    Post subject: Reply with quote

Yes, it will. I've good cross-platform naming service in both directions supported by dnsmasq.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
d4mo
Guru
Guru


Joined: 27 Jun 2005
Posts: 430

PostPosted: Thu May 21, 2009 7:31 pm    Post subject: Reply with quote

So what service is sending the hostname out on the nix boxes to the dnsmasq then?
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10733
Location: Somewhere over Atlanta, Georgia

PostPosted: Thu May 21, 2009 7:46 pm    Post subject: Reply with quote

DHCP client.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
szczerb
Veteran
Veteran


Joined: 24 Feb 2007
Posts: 1709
Location: Poland => Lodz

PostPosted: Thu May 21, 2009 8:39 pm    Post subject: Reply with quote

And it's not a service ;]
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Thu May 21, 2009 9:29 pm    Post subject: Reply with quote

echo "windowsIPname1 windowscompname1" >> /etc/hosts

as simple as that, no programs needed. If your windows comp have statics ip of course.
so ping, ssh... windowscompname1 will be resolved to windowsIPname1

and there's also a file in windows that does the same thing for your linux computers. but i don't remember where/what is it, but pretty sure a windows user could point it out easy.
Back to top
View user's profile Send private message
szczerb
Veteran
Veteran


Joined: 24 Feb 2007
Posts: 1709
Location: Poland => Lodz

PostPosted: Thu May 21, 2009 11:04 pm    Post subject: Reply with quote

krinn wrote:
echo "windowsIPname1 windowscompname1" >> /etc/hosts

as simple as that, no programs needed. If your windows comp have statics ip of course.
so ping, ssh... windowscompname1 will be resolved to windowsIPname1

and there's also a file in windows that does the same thing for your linux computers. but i don't remember where/what is it, but pretty sure a windows user could point it out easy.
Sure...why do we need DNS servers at all :lol:
Back to top
View user's profile Send private message
Malvineous
Apprentice
Apprentice


Joined: 20 Oct 2006
Posts: 281
Location: Brisbane, Australia

PostPosted: Fri May 22, 2009 1:26 am    Post subject: Reply with quote

krinn wrote:
and there's also a file in windows that does the same thing for your linux computers. but i don't remember where/what is it, but pretty sure a windows user could point it out easy.

Now I'm ashamed to admit I know this, but it's %windir%\system32\drivers\etc\hosts and it works the same as the *nix hosts file.

Also the service that handles Windows network names is "nmbd" (part of the Samba package.) It will allow a Windows machine to map your Samba name (which you probably want to set the same as your hostname) into an IP address. This will allow Windows PCs to ping your Linux box without editing their hosts file. You don't have to actually run Samba (smbd) but you will need the nameserver (nmbd) running.

I'm not aware of any way of automatically mapping Windows names to IPs on the Linux side, but the "nmblookup" program can do it in a similar way as "nslookup" or "host" do, it's just a bit more manual. Note that winbind is more aimed at integrating your Linux machine in with Active Directory, it handles the mapping of users, groups and logins rather than hostnames. (For example using winbind you can let users in Active Directory SSH into your Linux box without creating a specific account for them first.)
Back to top
View user's profile Send private message
szczerb
Veteran
Veteran


Joined: 24 Feb 2007
Posts: 1709
Location: Poland => Lodz

PostPosted: Fri May 22, 2009 11:15 am    Post subject: Reply with quote

But instead of setting up netbios name resolution you should just use a working DNS server ;/
Back to top
View user's profile Send private message
d4mo
Guru
Guru


Joined: 27 Jun 2005
Posts: 430

PostPosted: Fri May 22, 2009 1:33 pm    Post subject: Reply with quote

Well here's the deal. I turned on Local DNS on DDwrt. I can ping Windows computers from my nix box by name just fine. But I can't do it the other way around.

From what you guys are saing DHCP should be sending my hostname to DNSmasq on my router and I should need any part of samba to do it...correct? Or am I mistaken.

Also I don't use static IPs, so I don't want to do host file entries. I also just want to get this to work out of principle.
Back to top
View user's profile Send private message
szczerb
Veteran
Veteran


Joined: 24 Feb 2007
Posts: 1709
Location: Poland => Lodz

PostPosted: Fri May 22, 2009 2:28 pm    Post subject: Reply with quote

Did you get new leases for windows hosts after turning on local DNS?
Back to top
View user's profile Send private message
d4mo
Guru
Guru


Joined: 27 Jun 2005
Posts: 430

PostPosted: Fri May 22, 2009 2:36 pm    Post subject: Reply with quote

I believe so. The computer was turned off and not listed in DDwrt as having a lease. But i don't think that is the problem anyways. Because in DDwrt when you look at who is connected to your router it says what there host name is. It shows up for all my Windows machines, but my nix box just shows up as a *. Same as my 360, which I assume has no name.
Back to top
View user's profile Send private message
szczerb
Veteran
Veteran


Joined: 24 Feb 2007
Posts: 1709
Location: Poland => Lodz

PostPosted: Fri May 22, 2009 2:43 pm    Post subject: Reply with quote

Then your nix has a misconfigured dhcp client which doesn't send it's host name.
Back to top
View user's profile Send private message
d4mo
Guru
Guru


Joined: 27 Jun 2005
Posts: 430

PostPosted: Fri May 22, 2009 3:11 pm    Post subject: Reply with quote

Where would the setting be for that...or what would I be looking for?
Back to top
View user's profile Send private message
d4mo
Guru
Guru


Joined: 27 Jun 2005
Posts: 430

PostPosted: Fri May 22, 2009 11:02 pm    Post subject: Reply with quote

Ok, I kind of have it working. DD-wrt shows it as my host name. And on windows if I do a ping -a 192.168.xxx.xxx it shows my host name and the IP. But the weird thing is if I do a ping hostname on windows it says host in unreachable. Any idea why?
Back to top
View user's profile Send private message
szczerb
Veteran
Veteran


Joined: 24 Feb 2007
Posts: 1709
Location: Poland => Lodz

PostPosted: Sat May 23, 2009 11:48 am    Post subject: Reply with quote

Usually hosts are unreachable when there is no root to them...right? So do you have a fancy setup with multiple networks with different addresses or something?
Back to top
View user's profile Send private message
d4mo
Guru
Guru


Joined: 27 Jun 2005
Posts: 430

PostPosted: Sat May 23, 2009 2:35 pm    Post subject: Reply with quote

No, just a standard 192.168.1.x Class C network.
Back to top
View user's profile Send private message
szczerb
Veteran
Veteran


Joined: 24 Feb 2007
Posts: 1709
Location: Poland => Lodz

PostPosted: Sat May 23, 2009 3:41 pm    Post subject: Reply with quote

That's weird...like you don't have the route to the local network ;/
Back to top
View user's profile Send private message
Malvineous
Apprentice
Apprentice


Joined: 20 Oct 2006
Posts: 281
Location: Brisbane, Australia

PostPosted: Sat May 23, 2009 11:58 pm    Post subject: Reply with quote

When you say ping "192.168.xxx.xxx" you do realise that's up to 256 different class C networks? As in, if you're on 192.168.1.xxx and you try to ping 192.168.0.xxx you'll need a machine routing the traffic between the two subnets?
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
Goto page 1, 2  Next
Page 1 of 2

 
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