Yes another post about esxcli, what can I say I’m studying very hard for my VCP5 and from time to time this kind of unknown information, at least for me, arise and I believe it can be useful for some of you.
Again we are going to make use of the system namespace.
First task of course is to get current hostname.
Next change the hostname, but you should check before what options are at your disposal by getting the command help.
Interesting, you can change the short hostname, the domain or the fully qualified domain name. Take into account that --fqdn option is mutually exclusive with the others.