7

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?

5
  • Can you ping or traceroute to the server by netbios name?
    – CIA
    Feb 26, 2013 at 5:32
  • All on the same subnet? Feb 26, 2013 at 7:21
  • 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?
    – s.co.tt
    Jul 30, 2013 at 18:06
  • Should you uncomment wins support?
    – Serhiy
    Mar 19, 2015 at 3:06
  • 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.
    – alecov
    Mar 28, 2017 at 0:32

2 Answers 2

6

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.

2
  • 1
    systemctl enable nmbd rather than nmb
    – agrath
    Apr 15, 2019 at 3:48
  • This worked for me perfectly: sudo systemctl enable nmb sudo systemctl restart nmb
    – Jimbo
    Oct 20, 2020 at 21:52
1

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?

3
  • 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. Jul 20, 2011 at 9:03
  • 1
    But are these other machines set up in a DNS / WINS? And is the Samba-server too? Since you use "local master = yes" browsing lookups will be used on the Samba-server, hence set it up as or use a WINS-server or add a LMHOSTS-file for name based lookups. More info here: samba.org/samba/docs/man/Samba-HOWTO-Collection/…
    – Henk
    Jul 20, 2011 at 9:45
  • 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. Jul 20, 2011 at 10:12

You must log in to answer this question.

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