[Samba] samba 3.5.6 - ''smbclient -U% -Llocalhost' results in error - using hostname works fine, new feature?

Günter Kukkukk linux at kukkukk.com
Sat Dec 18 20:02:22 MST 2010

Am Samstag 18 Dezember 2010, 22:04:34 schrieb David C. Rankin:
> Guys,
> 	I have probably missed an announcement or overlooked something in a changelog,
> but I just want to confirm what I'm seeing is expected behavior. I run samba in
> standalone mode and I have always checked operation with
> smbclient -U% -Llocalhost
> 	Now the faithful command returns an error:
> Connection to localhost failed (Error NT_STATUS_BAD_NETWORK_NAME)
> 	Simply using the hostname instead of localhost works, and samba continues to
> work fine. So this is really just confirmation request that what I'm seeing is
> what I'm supposed to be seeing.
> [14:55 nirvana:/etc] # smbclient -U% -Lnirvana
> Domain=[RB_LAW] OS=[Unix] Server=[Samba 3.5.6]
>         Sharename       Type      Comment
>         ---------       ----      -------
>         IPC$            IPC       IPC Service (Samba 3.5.6)
> <snip>
> 	So what say the experts? New security feature?

The returned error NT_STATUS_BAD_NETWORK_NAME just says, that for
some reason(s) "localhost" is not a known network name anymore.

Have you looked at your smb.conf option setting of  "name resolve order = ..."
The default is:
  name resolve order = lmhosts wins host bcast

You can check with:
   testparm -vs 2>&1 | grep 'name resolve order'

If you for example only set:
   name resolve order = wins bcast
you'll get NT_STATUS_BAD_NETWORK_NAME for "localhost".

What's the contents of

Can you ping localhost ?
A similar (but not equal) behaviour is seen when you omit localhost from
the smb.conf option "interfaces" and also set "bind interfaces only=yes". e.g.
   interfaces = eth0
   bind interfaces only = yes
But in this case 'smbclient -L localhost -U%' will return NT_STATUS_CONNECTION_REFUSED.

Cheers, Günter

More information about the samba mailing list