Life is what happens while you are making other plans.
Use sysctl to change the variable kernel.hostname:
Use:
sysctl kernel.hostname
To read the current hostname, and
sysctl kernel.hostname=NEW_HOSTNAME
To change it.