0

Two machines connected to a switch: WLADIMIR (XP Home SP3) and DAGO (Win7 Pro).

WLADIMIR has received 192.168.33.130 via DHCP, DAGO has received 192.168.33.156. They can ping each other by IP address.

Now, I'd like to get the NetBIOS names to work as well. However, "host not found", both ways.

Okay, I can temporarily fix that by issuing the following command on WLADIMIR:

nbtstat -A 192.168.33.156
REM This fetches DAGO's names and puts them into the cache.
ping dago
REM Successful ping!
nbtstat -c
REM Shows names in the cache. They'll stay for ten minutes.

Here's the netstat output for WLADIMIR (XP):

:: netstat -ano | findstr 130:13
TCP    192.168.33.130:139     0.0.0.0:0              ABHÖREN         4
UDP    192.168.33.130:137     *:*                                    4
UDP    192.168.33.130:138     *:*                                    4

And for DAGO (Win7):

TCP    192.168.33.156:139     0.0.0.0:0              ABHÖREN         4
UDP    192.168.33.156:137     *:*                                    4
UDP    192.168.33.156:138     *:*                                    4

Excerpt from the services file:

netbios-ns        137/tcp    nbname                 #NETBIOS Name Service
netbios-ns        137/udp    nbname                 #NETBIOS Name Service
netbios-dgm       138/udp    nbdatagram             #NETBIOS Datagram Service
netbios-ssn       139/tcp    nbsession              #NETBIOS Session Service

Hmm, 137/tcp isn't open. Possible cause?

On the WINS tab of my LAN connection, the LMHOSTS box is checked and the NetBIOS setting is set to "standard" on both machines.

Here's a good article from 2003 on NetBIOS name resolution.

Questions:

(1) I guess NetBIOS names are designed to work automatically, without me intervening to call nbtstat. How do I enable this? Any services the functionality depends upon? Any firewall interference?

(2) It doesn't work the other way round, that is Win7 pinging XP by name. The nbtstat -A appears to only succeed after the same command has been issued from XP; failing that, an empty table seems to be transferred. (Sort of like: Won't show you mine unless I've seen yours.) And even after transfer of the actual table, ping WLADIMIR still won't work.

Thanks.

1 Answer 1

1

The NetBIOS Name Service (netbios-ns) typically uses UDP not TCP. I've never seen it use TCP. The only reliable way to get NetBIOS name resolution working is to populate the lmhosts file on each host or to implement a WINS or NBNS server.

4
  • Hey Joe, thanks. According to documentation and various sources on the Net, it is supposed to work fine with broadcasts within one subnet, which is the situation I have. See one Herb Martin's comments on this page: goo.gl/jwOhn - And it currently does work fine on my two machines without manual ntbstat intervention. :-) The only thing I've done is issue an nbtstat -A 192.168.33.1 to see if my router also has a NetBIOS table (it doesn't).
    – Lumi
    Jan 25, 2011 at 2:09
  • Could you expand on why LMHOSTS or WINS are the only reliable ways, implying by exclusion that broadcast is unreliable? Which it is, from what I've been able to collect, only when your hosts are spread over multiple subnets.
    – Lumi
    Jan 25, 2011 at 2:12
  • Broadcast methods aren't guaranteed to elicit a response. Broadcasting is somewhat of a "best effort" attempt to discover/communicate with other hosts via NetBIOS. A WINS or NBNS server on the other hand is, like DNS, a central repository for host names (NetBIOS names in this case) for hosts to register with and query for NetBIOS names.
    – joeqwerty
    Jan 25, 2011 at 2:57
  • Thanks once more, Joe - your experience is appreciated. - One more finding for the situation I described: After turning on the logfile on the Personal Firewall on XP Home - C:\WINDOWS\pfirewall.log - I could see that it dropped packets for 137/udp destinated for either that machine or the subnet broadcast address, and all that despite the fact that I had configured an exception for file and printer sharing, which does include NetBIOS-NS. - Maybe a reboot will help.
    – Lumi
    Jan 25, 2011 at 16:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .