How to change hostname in Debian 8

by Daniel Pham
Published: Updated:

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.

How to change hostname in Debian 8
Using the hostnamectl command to change 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.

(This is an article from my old blog that has been inactive for a long time, I don’t want to throw it away so I will keep it and hope it helps someone).

0 0 votes
Article Rating

You may also like

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments

DevOps Lite is a personal blog specializing in technology with main topics about DevOps, DevSecOps, SRE and System Administrator. Articles are shared for free and contributed to the community.

SUPPORT US

FOLLOW US

Subscribe my Newsletter for new blog posts. Stay updated from your inbox!

© 2021-2024 DevOpsLite.com – All rights reserved.

Please write sources “DevOpsLite.com” when using articles from this website.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

0
Would love your thoughts, please comment.x
()
x

Adblock Detected

Please support us by disabling your AdBlocker extension from your browsers for our website.