cannot resolve windows host name

Bug #270395 reported by clovepower
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
samba (Ubuntu)
Won't Fix
Undecided
Unassigned

Bug Description

Ubuntu 8.04.1 AMD64

Linux set 2.6.24-19-generic #1 SMP Wed Aug 20 17:53:40 UTC 2008 x86_64 GNU/Linux
Samba 3.0.28a-1ubuntu4.5

Binary hint samba

I cannot resolve Windws host names for other computers on my LAN.

ping <host>

where <host> is a Windows computer name fails.

To fix this I had to:

1) Install winbind

2) manually edit /etc/samba/smb.conf:

#======================= Global Settings =======================

[global]

   name resolve order = lmhosts bcast wins host

3) manually edit /etc/nsswitch.conf

hosts: files dns wins

Since this is an easy fix and since this is definitely an essential feature, can't these settings be used by default?

Revision history for this message
clovepower (mzattera) wrote :
Revision history for this message
Joel Goguen (jgoguen) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. You reported this bug a while ago and there hasn't been any activity in it recently. We were wondering if this is still an issue for you. Can you try with the latest Ubuntu release? Also, could you let us know whether you have a DNS server on your network? Thanks in advance.

Changed in samba:
status: New → Incomplete
Revision history for this message
Steve Langasek (vorlon) wrote :

The description in this bug report is complete; it is a request to enable the WINS NSS module by default.

However, I'm going to have to mark this bug 'wontfix', because the nss_wins module isn't mature enough to enable it by default, and using it can cause recursion problems for apps in a variety of cases. Some details can be found in Debian bug #459972.

I believe anyone in this situation is better off deploying DNS than bolting WINS onto their Ubuntu systems. Microsoft appears to agree, given that their current domain technology (Active Directory) uses DNS.

Changed in samba:
status: Incomplete → Won't Fix
Revision history for this message
clovepower (mzattera) wrote :

Just to be clear.

Are you suggesting that to have my Ubuntu laptop to connect to my Windows desktop on my 3 PC LAN, I've to setup an internal DNS server?

Or do I miss something?

Revision history for this message
clovepower (mzattera) wrote :

This is confirmed with

Ubuntu Jaunty alpha5 AMD64

samba 2:3.3.0-3ubuntu2

and no, I do not have any DNS server on my LAN.

I cannot try the above fix because Synaptic fails when installing winbind (404 file not found), but still I'm not able to do:

ping <host>

Notice that if I open Nautilis to smb://<host>/ I can see shared folder on my Windows host, so in such a case the name is resolved correctly.

Revision history for this message
Joel Goguen (jgoguen) wrote :

This is because using 'ping <host>' attempts to look up a host using DNS. Using 'smb://<host>/' uses lmhosts. If you were to go to Windows and type 'ping <host>' it would fail the same way.

Revision history for this message
clovepower (mzattera) wrote :

Actually if I go to Windows and do

ping <Windows Host Name>

it works, and if I do

ping <Linux Laptop Name>

it works too.

IMHO I think that most, if not all, Ubuntu users will sooner or later plug their laptop into a LAN and they will expect to see other PCs, hence this bug somehow will need to be addressed either fixing winbind or with some other voodoo.

I think this is such a basic feature that WON'T FIX is inappropriate

Revision history for this message
Steve Langasek (vorlon) wrote : Re: [Bug 270395] Re: cannot resolve windows host name

On Sat, Mar 14, 2009 at 09:39:36PM -0000, clovepower wrote:
> Are you suggesting that to have my Ubuntu laptop to connect to my
> Windows desktop on my 3 PC LAN, I've to setup an internal DNS server?

If you need to access your Windows PCs across the network for services other
than Windows filesharing, there are a number of options available.

- configure your Windows machines to use zeroconf, which is supported by
  default in both MacOS X and Ubuntu, and access your Windows machines using
  the convention <name>.local.
- configure a DNS server on your local network
- configure nss_wins on your Ubuntu system.

The first of these is the only one I can really recommend; the second option
is obviously a lot of work to maintain relative to the benefit and doesn't
help you for mobile systems on foreign networks that don't run this kind of
DNS, and the third one depends on software that has various problems as
noted.

--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
<email address hidden> <email address hidden>

Revision history for this message
clovepower (mzattera) wrote :

Thanks Steve, I was not aware of the options.

So far winbind appears to be working good on my LAN...and until it works do not fix it :)

Revision history for this message
svaens (svaens) wrote :

Geez. I agree. This should be fixed. Thanks to the reporter of this, and the supplied fix.
But as the reporter said, I can't believe this is not considered to be necessary to be made default for ubuntu. If Ubuntu is to 'just work', users will want this already in place.

Revision history for this message
Ralph (ralph-sleigh) wrote :

I agree that resolving windows names should happen by default (and while outside the scope of this bug, 2 fresh ubuntu installs on the same LAN should really also resolve each others names).

Revision history for this message
cloudboy (whitecloudboy00) wrote :

+1 ...this is an aggravating manual step every time I setup a new ubuntu machine among a myriad of windows boxes. If we are going to supplant the dominant OS, we have to be able to interact with it as seamlessly as possible.

Revision history for this message
Tor Sjowall (u-cor-u) wrote :

This problem is still unsolved.

The host names of windows PCs are not visible to Linux programs with a regular installation of Samba,
i.e. from Linux 'ping win_pc' does not work, but from windows 'ping linux_pc' does work.

Also, 'nmblookup win_pc' works, while 'nslookup win_pc' does not work.

Installing winbind and changing the nsswitch.conf's host: definition to 'host: files dns wins' fix the problem.
This is not obvious to a naive user.

I suggest changing the host definition in nsswitch.conf on installation of winbind
I also suggest installing winbind together with Samba

This would improve the user experience when working in a mixed Ubuntu/Windows network environment.
The whole point of the Samba package is to make it possible to work in such a mixed environment.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.