1

I have an SMB file server on my network with the hostname MY-SERVER and the address of 192.168.1.10. On some machines, I can connect to its shared directory using the hostname (smb://my-server/ or \\my-server, both upper and lower case are fine). On other machines, it always throws an error, and force me to connect using the IP address (smb://192.168.1.10/).

The hostname is unique across my small network. What could be the cause of this issue?

  • What OS do all machines (clients, working servers, non-working servers) run? Are the names resolvable via regular DNS using dig/host/nslookup? – user1686 Apr 19 '19 at 6:41
  • I currently use Ubuntu as server, but did have Windows as server in the past. The clients are both Ubuntu and Windows. The problem occurs randomly, even with Windows as the server. I did a dig my-server on Terminal. It returned several lines of result, none contained the IP address 192.168.1.10. – Livy Apr 19 '19 at 7:02
  • looks like this question could help: superuser.com/questions/230613/… – myrdd Jul 2 '19 at 12:54
  • @grawity I think this has nothing to do with DNS, but with NBNS. man 1 smbclient says: ”The name required is a NetBIOS server name“. – myrdd Jul 2 '19 at 13:34
  • 1
    @myrdd: That hasn't been true for ages. (It still has some relevance for SMBv1 as the server might specifically check this value against its own hostname (similar to TLS SNI or HTTP vhosts), although SMBv2 servers no longer do so.) But regardless of that, smbclient is perfectly capable of accepting raw IP addresess, as well as resolving the names via DNS or files. I frequently use both the CLI smbclient and the GVfs module in environments without any trace of NBNS or WINS (or SMBv1). – user1686 Jul 2 '19 at 17:30
1

Probably not yet a complete answer, but it should be noted that SMB clients — at least the CLI client smbclient, which is part of the Samba software suite — expect the server name to be a NetBIOS server name, as opposed to DNS. So, in order to debug your issue, you need to query the NetBIOS Naming Service (NBNS): run the CLI command nmblookup my-server, it's available for both Linux (through the Samba Suite) and Windows.

If your SMB server is Samba's smbd, you should also install and configure nmbd

Links

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.