View previous topic :: View next topic |
Author |
Message |
d4mo Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/gallery/Star Wars/movie_star_wars_storm_trooper.gif)
Joined: 27 Jun 2005 Posts: 430
|
Posted: Thu May 21, 2009 1:36 pm Post subject: Ping windows machines by name |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
Hu Administrator
![Administrator Administrator](/images/ranks/rank-admin.gif)
Joined: 06 Mar 2007 Posts: 23100
|
Posted: Thu May 21, 2009 2:04 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
John R. Graham Administrator
![Administrator Administrator](/images/ranks/rank-admin.gif)
![](images/avatars/1323583785534df64897db0.jpg)
Joined: 08 Mar 2005 Posts: 10733 Location: Somewhere over Atlanta, Georgia
|
Posted: Thu May 21, 2009 2:32 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
szczerb Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
Joined: 24 Feb 2007 Posts: 1709 Location: Poland => Lodz
|
Posted: Thu May 21, 2009 2:53 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
John R. Graham Administrator
![Administrator Administrator](/images/ranks/rank-admin.gif)
![](images/avatars/1323583785534df64897db0.jpg)
Joined: 08 Mar 2005 Posts: 10733 Location: Somewhere over Atlanta, Georgia
|
Posted: Thu May 21, 2009 3:03 pm Post subject: |
|
|
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.
- John _________________ I can confirm that I have received between 0 and 499 National Security Letters. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
szczerb Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
Joined: 24 Feb 2007 Posts: 1709 Location: Poland => Lodz
|
Posted: Thu May 21, 2009 4:25 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
d4mo Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/gallery/Star Wars/movie_star_wars_storm_trooper.gif)
Joined: 27 Jun 2005 Posts: 430
|
Posted: Thu May 21, 2009 5:00 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
John R. Graham Administrator
![Administrator Administrator](/images/ranks/rank-admin.gif)
![](images/avatars/1323583785534df64897db0.jpg)
Joined: 08 Mar 2005 Posts: 10733 Location: Somewhere over Atlanta, Georgia
|
Posted: Thu May 21, 2009 6:13 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
d4mo Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/gallery/Star Wars/movie_star_wars_storm_trooper.gif)
Joined: 27 Jun 2005 Posts: 430
|
Posted: Thu May 21, 2009 7:31 pm Post subject: |
|
|
So what service is sending the hostname out on the nix boxes to the dnsmasq then? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
John R. Graham Administrator
![Administrator Administrator](/images/ranks/rank-admin.gif)
![](images/avatars/1323583785534df64897db0.jpg)
Joined: 08 Mar 2005 Posts: 10733 Location: Somewhere over Atlanta, Georgia
|
Posted: Thu May 21, 2009 7:46 pm Post subject: |
|
|
DHCP client.
- John _________________ I can confirm that I have received between 0 and 499 National Security Letters. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
szczerb Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
Joined: 24 Feb 2007 Posts: 1709 Location: Poland => Lodz
|
Posted: Thu May 21, 2009 8:39 pm Post subject: |
|
|
And it's not a service ;] |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
krinn Watchman
![Watchman Watchman](/images/ranks/rank-G-2-watchman.gif)
![](images/avatars/gallery/Blade Runner/movie_blade_runner_howl.gif)
Joined: 02 May 2003 Posts: 7470
|
Posted: Thu May 21, 2009 9:29 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
szczerb Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
Joined: 24 Feb 2007 Posts: 1709 Location: Poland => Lodz
|
Posted: Thu May 21, 2009 11:04 pm Post subject: |
|
|
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 ![Laughing :lol:](images/smiles/icon_lol.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Malvineous Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/18723455534882c8282ef47.png)
Joined: 20 Oct 2006 Posts: 281 Location: Brisbane, Australia
|
Posted: Fri May 22, 2009 1:26 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
szczerb Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
Joined: 24 Feb 2007 Posts: 1709 Location: Poland => Lodz
|
Posted: Fri May 22, 2009 11:15 am Post subject: |
|
|
But instead of setting up netbios name resolution you should just use a working DNS server ;/ |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
d4mo Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/gallery/Star Wars/movie_star_wars_storm_trooper.gif)
Joined: 27 Jun 2005 Posts: 430
|
Posted: Fri May 22, 2009 1:33 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
szczerb Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
Joined: 24 Feb 2007 Posts: 1709 Location: Poland => Lodz
|
Posted: Fri May 22, 2009 2:28 pm Post subject: |
|
|
Did you get new leases for windows hosts after turning on local DNS? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
d4mo Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/gallery/Star Wars/movie_star_wars_storm_trooper.gif)
Joined: 27 Jun 2005 Posts: 430
|
Posted: Fri May 22, 2009 2:36 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
szczerb Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
Joined: 24 Feb 2007 Posts: 1709 Location: Poland => Lodz
|
Posted: Fri May 22, 2009 2:43 pm Post subject: |
|
|
Then your nix has a misconfigured dhcp client which doesn't send it's host name. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
d4mo Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/gallery/Star Wars/movie_star_wars_storm_trooper.gif)
Joined: 27 Jun 2005 Posts: 430
|
Posted: Fri May 22, 2009 3:11 pm Post subject: |
|
|
Where would the setting be for that...or what would I be looking for? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
d4mo Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/gallery/Star Wars/movie_star_wars_storm_trooper.gif)
Joined: 27 Jun 2005 Posts: 430
|
Posted: Fri May 22, 2009 11:02 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
szczerb Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
Joined: 24 Feb 2007 Posts: 1709 Location: Poland => Lodz
|
Posted: Sat May 23, 2009 11:48 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
d4mo Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/gallery/Star Wars/movie_star_wars_storm_trooper.gif)
Joined: 27 Jun 2005 Posts: 430
|
Posted: Sat May 23, 2009 2:35 pm Post subject: |
|
|
No, just a standard 192.168.1.x Class C network. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
szczerb Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
Joined: 24 Feb 2007 Posts: 1709 Location: Poland => Lodz
|
Posted: Sat May 23, 2009 3:41 pm Post subject: |
|
|
That's weird...like you don't have the route to the local network ;/ |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Malvineous Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/18723455534882c8282ef47.png)
Joined: 20 Oct 2006 Posts: 281 Location: Brisbane, Australia
|
Posted: Sat May 23, 2009 11:58 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
|