The source code in the official samba git (source/lib/util.c) seems to
use HOST_NAME_MAX and I found an inconsistency in the code base:
source/lib/replace/replace.h:
384 #ifndef HOST_NAME_MAX
385 #define HOST_NAME_MAX 255
source/lib/replace/system/network.h
269 #ifndef HOST_NAME_MAX
270
Mac OS X broadcasts the first 15 characters of your hostname via
NetBIOS. This works for them so it could be a good solution for Ubuntu
as well.
If you have to, you could perhaps set up a truncated hostname alias if
the samba hostname must be reachable through /etc/hosts? That way the
machine coul