Linux Server Install: Part 8
You’re gonna want to change that hostname, bruh.
Previous
Hostname
The default hostname
should be obvious (ubuntu) but you can check with:
hostname
You can get more information with:
hostnamectl
To change the hostname
, you can run:
sudo hostnamectl set-hostname [hostname]
Where [hostname]
is the name you want it to be. If you run hostnamectl
again, you should see the new hostname
.
There’s one more place you need to change it and that’s in /etc/hosts
sudo nano /etc/hosts
Change ubuntu
to the name you selected in the previous step.
That’s it! Your server should now be using the new hostname
. You may need to log out and log back in for the changes to take effect.
Note
Some applications may still use the old hostname until they are restarted. You may need to restart these applications manually to update their configuration.