For this procedure you need to enable SSH access to your ESXi host.
You can change the hostname, also fqdn if you want, via two commands. Both will be shown below.
NOTE: In this example, I will change fqdn (meaning hostname.domain).
Via esxcfg-advcfg:
[root@local:~] esxcfg-advcfg -s mini.local /Misc/hostname Value of HostName is mini.local
or via esxcli command:
[root@local:~] esxcli system hostname set --fqdn=mini.local [root@mini:~]
In order to see your results, you can use also two commands, as shown below:
[root@mini:~] esxcli system hostname get Domain Name: local Fully Qualified Domain Name: mini.local Host Name: mini
[root@mini:~] esxcfg-advcfg -g /Misc/hostname Value of HostName is mini.local
Done! ;)