12.8. Troubleshooting NetBIOS Names
Historically, SMB protocols have depended on the NetBIOS name system, also called the LAN Manager name system. This was a simple scheme where each system had a unique 15-character name (plus one byte for the resource type) and broadcast it on the LAN for everyone to know. With TCP/IP, we tend to use names such as client.example.com, stored in /etc/hosts files or DNS.
The usual mapping of DNS names such as server.example.com to NetBIOS names uses the server part as the NetBIOS name and converts it to uppercase. Alas, this approach doesn't always work, especially if you have a system with a 16-character name; not everyone uses the same NetBIOS and DNS names. In this case, it would not be unusual to have a host with a NetBIOS name of corpvm1 and a DNS name of vm1.corp.com.
A system with a different NetBIOS name and DNS name is confusing when you're troubleshooting; we recommend that you try to avoid this wherever possible. NetBIOS names are discoverable with smbclient:
If you can list shares on your Samba server with smbclient -L short_name, the short name is the NetBIOS name.
If you get Get_Hostbyname: Unknown host name, there is probably a mismatch. Check in the smb.conf file to see whether the NetBIOS name is explicitly set.
Try to list shares again, specifying -I and the IP address of the Samba server (e.g., smbclient -L server -I 192.168.236.86). This command overrides the name lookup and forces the packets to go to the IP address. If this attempt works, there was a mismatch.
Try with -I and the full domain name of the server (e.g., smbclient -L server -I server.example.com). This tests the lookup of the domain name, using whatever scheme the Samba server uses (e.g., DNS). If it fails, you have a name service problem. You should reread the earlier section "Troubleshooting Name Services" after you finish troubleshooting the NetBIOS names.
If nothing is working so far, repeat the tests specifying -U username and -W workgroup, with the username and workgroup in uppercase, to make sure you're not being derailed by a user or workgroup mismatch.
If still nothing works and you had evidence of a name service problem, troubleshoot the name service (see the earlier section, "Troubleshooting Name Services") and then return to the NetBIOS name service.