How to change the hostname of your Linux machine without needing to restart

hostnamectl method Since Ubuntu 16.04 (and most recent Linux distros) use Systemd you can simply use the hostnamectl command to change hostname. To see current setting, run your Terminal just…