SystemMen - This tutorial shows you how to change hostname in Debian 9. In essence, Debian 9 works just like Debian 8. So you can apply the article I wrote for Debian 8, like this article.
Change hostname in Debian 9
To display the current hostname information, run the following command.
Next, to see the hostname declared in the /etc/hosts file, run the command below. The information in this file is usually used for dns or services such as web servers.
To make a hostname change in Debian9, this is an OS using systemd. So we can use the hostnamectl command.
Use can read the article for Debian 8.
hostnamectl set-hostname systemmen
Next, run the following command to change the hostname in the hosts file, this is to ensure services such as dns or web server stable operation.
sed -i 's/debian9/systemmen/g' /etc/hosts
Check the new hostname
Now you exit the current ssh session.
Make the ssh connection again and check the new hostname as shown in the image above.
Actually, the new Linux operating system, using systemd, has made some tasks simpler. It also reduces the difference between operating systems or versions. This article you can apply to Debian 8, Debian 9, Ubuntu 16, CentOS or any Linux OS using systemd.If you liked this article, then please subscribe to our YouTube Channel for more video tutorials. You can also find us on Twitter and Facebook.
If you appreciate what we share in this blog, you can support us by:
- Stay connected to: Facebook | Twitter | Google Plus | YouTube
- Subscribe email to recieve new posts from us: Sign up now.
- Start your own blog with SSD VPS - Free Let's Encrypt SSL ($2.5/month).
- Become a Supporter - Make a contribution via PayPal.
- Support us by purchasing Ribbon Lite Child theme being using on this website.
We are thankful for your support.