SystemMen - To change hostname in Debian 8, use the hostnamectl command. Debian 8 is among the new OSes, using systemd, based on dbus. This is quite handy when you want to change the hostname of the Ubuntu 16 or CentOS 7 server, etc.
The hostnamectl command to change hostname
The image below is an example of using the hostnamectl command to change the hostname in Debian 8.
You can see the article for Ubuntu 16 that I wrote here, in essence, changing hostnames in Debian and Ubuntu is the same.
1. Display the current hostname with the hostname
command.
hostname
2. Use the hostnamectl
command to change the hostname.
hostnamectl set-hostname systemmen
3. Step 3: Exit the current connection.
exit
4. Log in again
5. Check the new hostname
Conclusion
Using the hostnamectl
command is quite handy, because you can quickly change the hostname only through a single command. And it is important that you do not need to reboot the operating system.