Change Hostname Permanently on Debian or Ubuntu

Debian based systems use the file /etc/hostname to read the hostname of the computer at boot time and set it up using the init script /etc/init.d/

We can edit the file /etc/hostname and change the hostname and then run:

/etc/init.d/ start


1. sudo vim /etc/hostname
2. Save the file with the hostname you like to set
3. sudo /etc/init.d/ start



nJoy 😉

Write a Reply or Comment

Your email address will not be published.