Usually when you install Ubuntu, it will ask you for your username and assign a hostname to you, such as damien@damien-laptop. This is also what you will see in your terminal. If you don’t like the hostname shown in the terminal, or for some reason that you want to change the hostname, here’re the exact steps in Ubuntu. It is very easy. Just follow along and you will be done in a minute.

  1. First, open a terminal and type:

You should see a line stating your current hostname. For eg. damien-desktop

  1. Change the hostname to something you desired. Save and close the file.

  2. Back in your terminal, type:

  3. Change the line:

to

Save and close the file.

Restart the computer. Your new hostname should appear in the terminal now.

Damien Oh started writing tech articles since 2007 and has over 10 years of experience in the tech industry. He is proficient in Windows, Linux, Mac, Android and iOS, and worked as a part time WordPress Developer. He is currently the owner and Editor-in-Chief of Make Tech Easier.

Our latest tutorials delivered straight to your inbox