The Samba-Bugzilla – Bug 12861
"netbios name = %h" in smb.conf fails to expand and is shown as %H
Last modified: 2017-06-29 06:45:49 UTC
Specifying "netbios name = %h" in smb.conf results in the server showing up on the network as "%H"
It looks like the string gets capitalised before variable substitution and as a result the "%h" changes to "%H" and is never expanded.
This isn't a bug, or at least the change in behaviour was fairly deliberate.
The change was made in 74eed8f3ed5c333728350df1d23a4318e9104909 and included in Samba 4.0.
However, as the default is already the hostname, you should just be able to leave it unset.
This parameter is used in a server global context, so we don't really want it moving around with the % subs.
I am looking at a deployed base of a few thousand machines that have the redundant "netbios name = %h" entry in smb.conf
I'll take a look at adding a script to the samba init.d script to detect and delete the problematic line from smb.conf