Hm, now return True, but names are not changed after restart
For me it seems as if you look at the wrong position. Following the documentation only the NETBIOS name is changed by this function. This is not what you see in the system settings.
So you will have to follow the hint
in the documentation:
Zitat:
To set the DNS host name or the DNS domain name, call the
SetComputerNameEx function.
I guess you meant what SetComputerNameEx does.