Attention,
After changing the name of my truenas to just NAZ, I completely lost access to the server, Windows did not allow access and all that Windows stuff.
I researched and verified that newer Windows use the hostname to access and locate samba servers, not with smb1 or 2, but smb3 - in the case of Windows 10 and 11 or server 2019 (my case). As my truenas is on the network via DHCP managed by pfsense, the old name (truenas) was recorded in its DNS, and when accessing it using the new name it said it couldn’t find it, it said the spelling was wrong and I couldn’t even access it using the IP.
So for the record here, WHEN CHANGING THE NAME OF YOUR SMB SERVER, IT IS NECESSARY TO ADJUST THE DNS ON THE FIREWALL OR ROUTER THAT CONTROLS IT.
After this adjustment, I was able to access via the network, but NONE of my shares were listed, as I use “access based share enumeration” and group SID on each configured share, so users can only view the shares to which they have access. Well, when you change the name of the host/smb server, all the sid’s change, that is, I had to redo all my smb shares. As this isn’t written anywhere (at least I didn’t find it), I’m here now recording this so that future people won’t have so many difficulties.