Hi. I want to modify the host alias for a list of hosts. This can be done by editing hosts.mk but I am reluctant to edit that file. I would prefer to use a CLI command, or an API, or something similar but I understand that the alias is not part of the attribute list that can be set for a host.
Have I missed something or is the only way to set the host alias to do this manually via the GUI or by editing configuration files?
I had tried the API but made some mistake and could not get it to work, so I asked chat GPT who told me that it could not be done because āaliasā is not a proper attribute and can only be set via the hosts.mk file. This is clearly wrong as you explained and I have been able to set alias as you suggested.
Your advice, as always, is to the point, useful, and much appliciated. It is clearly also orders of magnitude more reliable than an AI