Unable to see Samba server by netbios name

30,445

Solution 1

This is on samba 4.7.1

I was having the same problem as OP and alecov. Turns out, nmb service were not running.

You need to enable nmb separately from smb:

sudo systemctl enable nmb
sudo systemctl restart nmb

On samba 4 the service names is smb and nmb, somehow needlessly renamed making many available tutorials to be confusing (they are mostly based on samba 3).

Here is my smb.conf that works to enable netbios name broadcasting:

        workgroup = WORKGROUP
        netbios name = XXXXX
#       disable netbios = yes
        wins support = yes
        name resolve order = bcast wins lmhosts

You also need to check if it bind properly with your target adapter and the samba service is allowed in the firewall.

Solution 2

Look into "Using Samba - 7.3 Name Resolution with Samba"
What does "nmblookup foobar" on the Samba-server gives you?
If that's not working (e.g. it gives "name_query failed to find name foobar"), have you tried setting up a WINS-server or added a LMHOSTS-file?

Share:
30,445

Related videos on Youtube

Phillip B Oldham
Author by

Phillip B Oldham

Delivery-focussed Python, Elixir, XSL/XQuery, and (No)SQL developer, micro-service developer, specialising in content/data migration, API/micro-service design, and Scrum mentorship.

Updated on September 18, 2022

Comments

  • Phillip B Oldham
    Phillip B Oldham almost 2 years

    We have a linux server set up with a number of samba shares on our mixed windows/mac/linux network. The shares are accessible if we go to \\192.168.x.x\share, however we can't access the server by it's netbios name (as set-up in the smb.conf file). It's also not listed on the network, whereas all the other machines are -- including the other linux machines.

    We're unable to see any difference in the config of the other machines compared to this particular one, other than that they are desktop Ubuntu machines and this is a "headless" CentOS server.

    Here's the config file:

    [global]
      workgroup = WORKGROUP # correct workgroup name for the network
      netbios name = foobar # same as the hostname of the box
      security = share
      guest account = nobody
      local master = no # tried yes, no difference
      preferred master = no # tried yes, no difference
      ; wins support = yes
      ; dns proxy = yes
    
    # shares are assigned here...
    

    The netbios name is set to the same value as the linux hostname for the box, but it's still not showing on the network whether we set the netbios name in samba or not.

    What else do I need to set so that the machine shows up on the network?

    • Simon Catlin
      Simon Catlin over 11 years
      All on the same subnet?
    • s.co.tt
      s.co.tt almost 11 years
      Do you have UDP 137 & 138 as well as TCP 139 and 445 open in your iptables config? Also, what is the state of selinux?
    • Serhiy
      Serhiy over 9 years
      Should you uncomment wins support?
    • alecov
      alecov over 7 years
      I'm having exactly the same problem. iptables is completely flushed (iptables -F), SELinux is disabled (setenforce 0), and no name resolution works. Bumping this question.
  • Phillip B Oldham
    Phillip B Oldham almost 13 years
    The issue is that other machines show up on the network with a name, just not this one. Not sure how editing the lmhosts file would help in this situation.
  • Phillip B Oldham
    Phillip B Oldham almost 13 years
    No WINS or DNS servers; it's a standard windows WorkGroup network set-up. All other machines added to the network just "show up", including the Ubuntu ones. It's just this one CentOS server.
  • agrath
    agrath about 5 years
    systemctl enable nmbd rather than nmb
  • Jimbo
    Jimbo over 3 years
    This worked for me perfectly: sudo systemctl enable nmb sudo systemctl restart nmb