Samba on FreeBSD: nmbd 'namequery' errors in terminal from other IPs on LAN

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

AveryFreeman

consummate homelabber
Mar 17, 2017
413
54
28
42
Near Seattle
averyfreeman.com
Hey,

so this has been an ongoing problem for me for at least a year now. It doesn't seem to have any negative effect other than being highly annoying.

I haven't noticed it on Linux VMs, but on my FreeBSD VMs (I've run at least 3 over the past year), my Samba configuration appears to be geeking out over an unknown issue and echoing the error to the terminal. Makes it hard to type sometimes when not accessing the VM via SSH.

Here's an example from today - the same info is logged in /var/log/samba4/nmbd.log, also:

Code:
This response was from IP 192.168.1.31, reporting an IP address of 192.168.1.31.
[2018/08/31 07:10:27.061128,  3] ../source3/nmbd/nmbd_incomingrequests.c:459(process_name_query_request)
And here's my /usr/local/etc/smb4.conf (I'm using WS2012R2 DCs):

Code:
[global]
        netbios name = FREEBSDSRV
        security = ADS
        workgroup = DOMAIN
        realm = DOMAIN.COM
        client use spnego = yes
        client signing = yes
        server signing = yes
        client ntlmv2 auth = yes
        encrypt passwords = yes

        log file = /var/log/samba4/%m.log
        log level = 3

        idmap config * : backend = tdb
        idmap config * : range = 3000-7999
        idmap config DOMAIN : backend = ad
        idmap config DOMAIN : schema_mode = rfc2307
        idmap config DOMAIN : range = 10000-999999
        idmap config DOMAIN : unix_nss_info = yes
        idmap config DOMAIN : unix_primary_group = yes

        ;winbind use default domain = yes
        winbind enum users = yes
        winbind enum groups = yes
        winbind offline logon = yes
        ;winbind nested groups = yes
        winbind refresh tickets = yes
        winbind nss info = rfc2307

        ;winbind nss info = template
        ;template shell = /bin/bash
        ;template homedir = /home/%D/%U
And lastly, the version of Samba I'm currently using:

Code:
# smbd --version
Version 4.7.7
Does anyone know if this is an error, and why is it being echoed to my terminal? Is there any good way to make it stop?
 

EffrafaxOfWug

Radioactive Member
Feb 12, 2015
1,394
511
113
This is just NMBD responding to NetBIOS queries. You've got a log level set to 3 which on your system might mean that these messages get echoed to console (depends entirely what logging rules you might have set up). Simplest way would be to change the logging config to stop these getting spammed to the console.

If you can get away with it, personally I'd disable netbios in smb.conf ('disable netbios = yes' in the global section) and rely on DNS instead - that should stop NMDB responding to these things at all. Similarly you could firewall off the netbios ports and hope nothing breaks.
 

AveryFreeman

consummate homelabber
Mar 17, 2017
413
54
28
42
Near Seattle
averyfreeman.com
This is just NMBD responding to NetBIOS queries. You've got a log level set to 3 which on your system might mean that these messages get echoed to console (depends entirely what logging rules you might have set up). Simplest way would be to change the logging config to stop these getting spammed to the console.

If you can get away with it, personally I'd disable netbios in smb.conf ('disable netbios = yes' in the global section) and rely on DNS instead - that should stop NMDB responding to these things at all. Similarly you could firewall off the netbios ports and hope nothing breaks.
Rad! Thank you, no matter how much google-fu I drop-kicked on my keyboard, I couldn't figure this out...

I will try disabling NetBIOS and also lower my log level (it's probably just a relic I had forgotten about from when I was first figuring out how to write samba configuration files)...

I hope nothing breaks, too ;)

Edit: I disabled netbios and lowered the log level to 5 on my main file server could still access its shares from Windows. Yay! Off to a good start...

Samba wiki doesn't describe different log levels very well, but I am guessing they're in descending levels from 1 - 10 (1 being most granular) and also had interesting stuff to say about logging auth / passdb info...

Setting the Samba Log Level - SambaWiki
 
Last edited:

EffrafaxOfWug

Radioactive Member
Feb 12, 2015
1,394
511
113
Samba wiki doesn't describe different log levels very well, but I am guessing they're in descending levels from 1 - 10 (1 being most granular) and also had interesting stuff to say about logging auth / passdb info...
It's t'other way around - 1 is a little logging, 2 is a fair amount of logging, 3 is a metric shit-ton of logging and anything higher is an imperial arse-wad of logging. Setting it to 10 is actually all the way up to eleven.
 

AveryFreeman

consummate homelabber
Mar 17, 2017
413
54
28
42
Near Seattle
averyfreeman.com
It's t'other way around - 1 is a little logging, 2 is a fair amount of logging, 3 is a metric shit-ton of logging and anything higher is an imperial arse-wad of logging. Setting it to 10 is actually all the way up to eleven.
oh shit! I wonder what I was reading that was the other way around, I think it was something related like realmd from when I was messing around with CentOS 7.

I'd better change this RIGHT AWAY! I don't need any (more) imperial arse-wads.