Skip to content

Change hostname

Warning: I had troubles with some of my systems after changing the hostname (namely I couldn’t SSH into the system anymore remotely). Make sure you’re knowing what you’re doing!

To change the hostname on a system, you need to edit the file /etc/hostname. The content of the file would be just:

To activate the change after you edited the file, run this command:

/etc/init.d/ start

Now the hostname command (which is used to display the hostname of the system) shows:

The change you made to the hostname file will be preserved upon system reboot.

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.