Page 1 of 1

Windows machines can't resolve a Linux host

Posted: Sat Jul 28, 2012 6:00 pm
by bthylafh
Here's my setup:

Linksys WRT54GL running Tomato Firmware as my router
2x Windows workstations; one's Vista, the other 7
an Ubuntu Server 12.04 fileserver, named glenlee, currently serving only SSH/SFTP and HTTP/HTTPS.
a couple random mobile devices.

So. I can't ping glenlee by its hostname from either of the Windows machines, or access SSH/HTTP/etc. except by using its statically-assigned IP address. None of the mobile devices (Android, Chrome OS, iOS) has this problem - hostname resolution works fine, likewise when I boot the Win7 box into Linux. This is a minor annoyance but I'd like to get it squared away.

glenlee used to have Samba installed and I'd set its SMB/NetBIOS hostname in the smb.conf, but couldn't get resolution.

Windows is able to resolve hostnames using NetBIOS over TCP/IP. I wonder if it's preferring to use this, doesn't get a result, and then fails to use DNS to resolve. Any suggestions?

Re: Windows machines can't resolve a Linux host

Posted: Sat Jul 28, 2012 6:55 pm
by Dizik
The quickest way to fix the problem would be to add a host file entry (c:\windows\system32\drivers\etc\hosts) for the Ubuntu server on the Windows boxes.

Re: Windows machines can't resolve a Linux host

Posted: Sat Jul 28, 2012 7:35 pm
by bthylafh
It would, but I want to fix the actual problem.

Re: Windows machines can't resolve a Linux host

Posted: Sat Jul 28, 2012 7:43 pm
by just brew it!
If you want to do it without individually creating entries in the hosts files, you need to either install Samba on the Linux hosts (and make sure the workgroup name is properly configured and nmbd is running); or set up a local DNS server for your network with entries for the Linux hosts.

Edit: Dnsmasq is actively maintained, available in the Ubuntu/Debian repositories, and easier to set up than a full-blown DNS server. FWIW I use it on my home LAN to serve both DNS and DHCP.

Re: Windows machines can't resolve a Linux host

Posted: Sat Jul 28, 2012 8:14 pm
by bthylafh
dnsmasq is included in Tomato, and it's got static entries for all non-mobile devices plus associated hostnames. The router is also providing DNS for the entire LAN plus Internet DNS.

Whatever's going on is specifically a Windows problem. The Win7 workstation resolves glenlee's hostname just fine when it boots Ubuntu.

Re: Windows machines can't resolve a Linux host

Posted: Sat Jul 28, 2012 8:19 pm
by Dizik
Do you have the router explicitly set up as the DNS for the NICs on the Windows machines? If not, try giving that a shot. If DNS is configured on the NICs, try doing an "ipconfig /flushdns" from the command line and try pinging again.

Re: Windows machines can't resolve a Linux host

Posted: Sat Jul 28, 2012 8:22 pm
by bthylafh
Yes, and I've tried that. :-?

The router's providing DHCP, which the workstations and the mobile devices are all using. The workstations have been rebooted more than once since I've tried this.

Haven't tried rebooting the router. Suppose I'll try that next.

Re: Windows machines can't resolve a Linux host

Posted: Sat Jul 28, 2012 8:24 pm
by Dizik

Re: Windows machines can't resolve a Linux host

Posted: Sat Jul 28, 2012 8:26 pm
by bthylafh
Rebooting the router didn't seem to do anything.

The stupid thing is that if I nslookup glenlee's IP address from the Win7 box it will come back with the correct hostname.

Re: Windows machines can't resolve a Linux host

Posted: Sat Jul 28, 2012 8:28 pm
by just brew it!
Try temporarily disabling the Windows firewall. If it starts working, then that is a big clue.

Edit: Installing Samba/nmbd on the Linux hosts is probably a worthwhile experiment as well...

Re: Windows machines can't resolve a Linux host

Posted: Sat Jul 28, 2012 9:38 pm
by bthylafh
Reinstalling Samba, setting it up as a WINS server, and telling the router about it has made it work.

Can't say I /like/ that setting up a WINS server seems to have been the solution for this (why doesn't straight DNS resolution work on Windows?) but I suppose I'll take it.

Re: Windows machines can't resolve a Linux host

Posted: Sat Jul 28, 2012 10:18 pm
by just brew it!
Microsoft has a history of playing fast and loose with standards, suffering from NIH syndrome, and lack of cooperation with (or outright hostility to) Open Source projects that want to inter-operate with them. Since they're the de facto standard desktop OS, the rest of the world's just gotta suck it up and deal with it.

Hey, it could be worse... try getting your Linux server to play nice with an Active Directory domain (i.e. use the Windows DC for Samba authentication) sometime! :lol: (We managed to get this going a while back, with Debian Linux and Windows Server 2003... getting it to work again with a newer version of Debian and Windows Server 2008 is the last thing holding up the cutover of a new Linux server for the Software Engineering group!)

Re: Windows machines can't resolve a Linux host

Posted: Sat Jul 28, 2012 11:12 pm
by bthylafh
Oh, I've done that. I had a Samba server auth against AD from '06 until just a couple weeks ago when it was retired, through three versions of Debian.

Worked pretty well until I upgraded from oldstable to stable last year; after that it wouldn't ever hold its AD group mappings and I had to set up a fix-script to run daily, forcing the ACLs to be a certain way.

I keenly miss the server already. We had gotten used to staying logged in as the user then tossing our credentials at the Samba server. With a Windows server, apparently, you have to log off, log on as yourself, then you can access the server's shares. I can see why they did it that way (security!) but it's annoying that you can't opt out.

Re: Windows machines can't resolve a Linux host

Posted: Mon Jul 30, 2012 9:32 am
by Flatland_Spider
This is strange. I have a very similar setup, and everything works great. I am running Fedora instead of Ubuntu, and I'm not running Samba as a wins servers.

Do you have avahi installed? I can't remember if it comes installed on ubuntu or not.


just brew it! wrote:
(We managed to get this going a while back, with Debian Linux and Windows Server 2003... getting it to work again with a newer version of Debian and Windows Server 2008 is the last thing holding up the cutover of a new Linux server for the Software Engineering group!)


Are you having problems with "unauthenticated" clients, i.e. clients not connected to the domain?

Re: Windows machines can't resolve a Linux host

Posted: Mon Jul 30, 2012 4:13 pm
by bthylafh
No, avahi's apparently not installed by default in Ubuntu Server.

Re: Windows machines can't resolve a Linux host

Posted: Mon Jul 30, 2012 7:11 pm
by bthylafh
That's not what winbind is for. It's used to bind to an NT4 domain or Active Directory.

Re: Windows machines can't resolve a Linux host

Posted: Mon Jul 30, 2012 7:23 pm
by Ryu Connor
I'd note that Microsoft no longer has any interest in supporting WINS.

WINS server fuctionality has been relegated to a Feature in Server 2008 & R2, no WINS support was integrated into the IPv6 stack, and a single label names option was provided to DNS via the GlobalNames Zone in 2008 & R2.

You might try disabling WINS/NetBIOS on the WIndows clients and seeing if you get the result you want.