"smbclient" does not resolve using WINS

Steffen Moser moser at egu.schule.ulm.de
Sat Apr 29 21:39:55 GMT 2000


Hello,

I am using "samba-2.0.7" and I am experiencing the following problem:

Machine A is configured as a WINS ("wins support = yes" in "smb.conf").
When I try to run the following command on machine A:

  "smbclient -M vm01"

I will get these results:

pc01:/usr/local/samba/bin # ./smbclient -M vm01
doing parameter name resolve order = wins lmhosts host bcast
doing parameter character set = ISO8859-1
doing parameter domain logons = Yes
doing parameter os level = 128
doing parameter preferred master = Yes
doing parameter domain master = Yes
doing parameter wins support = Yes
doing parameter hosts allow = ALL
pm_process() returned Yes
added interface ip=192.168.1.1 bcast=192.168.1.255 nmask=255.255.255.0
Client started (version 2.0.7).
resolve_wins: Attempting wins lookup for name vm01<0x3>
bind succeeded on port 0
resolve_lmhosts: Attempting lmhosts lookup for name vm01<0x3>
resolve_bcast: Attempting broadcast lookup for name vm01<0x3>
bind succeeded on port 0
Unable to resolve name vm01
pc01:/usr/local/samba/bin # 

I have to mention that "vm01" is a machine located in a different IP
network segment, so the name "vm01" cannot be resolved using broadcast.
It *has* to be resolved using WINS. 

"vm01" is correctly registered in the WINS database, but the name is not
resolved by "smbclient". 

If I try the following command:

  "smbclient -M pc20"

I will get these results:

pc01:/usr/local/samba/bin # ./smbclient -M pc20
doing parameter name resolve order = wins lmhosts host bcast
doing parameter character set = ISO8859-1
doing parameter domain logons = Yes
doing parameter os level = 128
doing parameter preferred master = Yes
doing parameter domain master = Yes
doing parameter wins support = Yes
doing parameter hosts allow = ALL
pm_process() returned Yes
added interface ip=192.168.1.1 bcast=192.168.1.255 nmask=255.255.255.0
Client started (version 2.0.7).
resolve_wins: Attempting wins lookup for name pc20<0x3>
bind succeeded on port 0
resolve_lmhosts: Attempting lmhosts lookup for name pc20<0x3>
resolve_bcast: Attempting broadcast lookup for name pc20<0x3>
bind succeeded on port 0
Got a positive name query response from 192.168.1.20 ( 192.168.1.20 )
Connecting to 192.168.1.20 at port 139
Connected. Type your message, ending it with a Control-D

I have to say that "pc20" is a machine located in the same IP network
segment, so the name "pc20" can be resolved by broadcast. But why is it
not resolved by using the WINS database? 

"pc20" is also correctly registered in the WINS database, but
"smbclient" is not able to resolve the name "pc20" using WINS. It is
resolved by broadcast then. 


There is also a machine B (also running samba-2.0.7). Machine B is not a
WINS server itself but uses machine A as WINS ("wins server =
192.168.1.1" in "smb.conf"). If I do an "smbclient"-command on this
machine, all machines which are registered in the WINS database are
resolved using the WINS database!

For example, if I do a "smbclient -M pc20" on machine B, I'll get a
positive name response from the wins server:

vm02:/usr/local/samba/bin # ./smbclient -M pc20
pm_process() returned Yes
added interface ip=192.168.158.3 bcast=192.168.158.255
nmask=255.255.255.0
Client started (version 2.0.7).
resolve_wins: Attempting wins lookup for name pc20<0x3>
bind succeeded on port 0
Got a positive name query response from 192.168.1.1 ( 192.168.1.20 )
Connecting to 192.168.1.20 at port 139
Connected. Type your message, ending it with a Control-D

So it seems that there is a bug in "smbclient": if you are running
"smbclient" on a samba machine that is configured as a WINS server
itself ("wins support = yes"), "smbclient" is not able to use the
("local") WINS database for resolving NetBIOS names to IP addresses.

If you are running "smbclient" on a samba machine that uses another
machine as a WINS server ("wins server = xxx.xxx.xxx.xxx"), "smbclient"
uses the WINS database of "xxx.xxx.xxx.xxx" to resolve NetBIOS names
without any problems.

The same thing happens when using "samba-2.0.6", so it is not a special
"2.0.7"-topic.

The same thing does not only happen with "smbclient -M". It occurs also
when doing an regular "smbclient"-access.

Has anybody experienced the same problem, yet? Is it a bug or a
misconfiguration of my system?

Bye,
Steffen


More information about the samba-technical mailing list