Change Hostname Permanently on Ubuntu 18.04.1 LTS

How to Change Hostname on Linux Ubuntu Unity

Change Hostname in Ubuntu: When we are new to Linux, we might not be sure about What is Username and What is Hostname and where all they influence. As days go, when we get used to Linux, we will get to know exactly about Username and Hostname. Initially, we would not have bothered much about these names but when we start using it, we might want to have a proper Username as well as Hostname. This hostname is little different from the Microsoft’s “Computer Name” as the Hostname and Username will reflect in Linux Terminal the most. In this article, we will see how to change the Hostname[Device name] on Linux Ubuntu Unity using different methods. Ubuntu also gives the option of changing this Hostname permanently as well as temporarily. Depending on your needs, you can proceed with the method that you wish to implement on your Linux Ubuntu Unity 18.04.1 LTS and also on your Ubuntu Unity 16.04 LTS.

Jump to:

How to Change Hostname in Linux Ubuntu Unity[Temporarily]:

Firstly, we will see how to change the Hostname in ubuntu temporarily. Temporarily means till you restart the Computer or Log off. To be more detailed, the changes that you have made to your Hostname will reflect until you log off or restart or shutdown your computer. Once you restart your Computer then the system will automatically adapt its earlier Hostname. Let’s get into the steps.

  • Open Linux Terminal in Ubuntu using the Command CTRL+ALT+T.
  • Once the Terminal is opened, Kindly enter the following command in the terminal. The Command is sudo hostname followed by your New Hostname.
    How to Change Hostname on Linux Ubuntu Unity
    Enter the Command
$ sudo hostname New-Hostname

How to Use? sudo hostname Tec-Robust and press Enter key.

  • Once the command is executed, you can find the changes made in the Linux Terminal itself. The New hostname will be displayed after that in the Terminal and also on the other places.

Example of the Command:

  • Open Terminal using CTRL+ALT+T. You will see the Username as well as the Hostname. Now we will change this Hostname.
    How to Change Hostname on Linux Ubuntu Unity
    Check the Hostname
  • Use the Command sudo hostname Orange-red and Press Enter Key.
    How to Change Hostname on Linux Ubuntu Unity
    Enter the Command
  • You will be asked to enter Password to execute the Command. Kindly enter the Password and press Enter key.
    How to Change Hostname on Linux Ubuntu Unity
    Enter Password
  • Now you can find the Hostname changed and will be reflecting your Linux Terminal as well as System Settings.
    How to Change Hostname on Linux Ubuntu Unity
    Hostname Changed

How to Change Hostname in Ubuntu Unity [Permanently] using GUI mode:

The above method is very simple and the Hostname in Ubuntu can be changed easily but it is temporary. Once you shut down your PC, then automatically the PC will adapt its earlier Hostname. Here in this section, we will see How to change the Hostname in Ubuntu Unity permanently using the GUI mode. It is much simpler than the earlier method. Kindly follow the below steps.

  1. Click on All Applications.
    How to Change Hostname on Linux Ubuntu Unity
    All Applications
  2. Scroll down and Locate Settings from the menu.
  3. Once you find the Menu Click and Open it.
  4. When the Settings panel opens, you will find Details at the Bottom of the Left pane. Click on the Details and Open it.
    How to Change Hostname on Linux Ubuntu Unity
    Choose Details
  5. It will display the System Information where you will find the Hostname(Device name).
  6. All you have to do is simple. Change the Device name with your New Hostname and press Enter Key.
    How to Change Hostname on Linux Ubuntu Unity
    Enter New Device Name
  7. There won’t be any notification. Kindly close the Settings panel and open the Linux Terminal. You will find the New Hostname in the terminal and this is permanent.

Get in Touch with Us:

In this article, we have seen How to Change Hostname in Ubuntu Unity 18.04.1 LTS using different methods. Kindly note that the above methods are also suitable for Linux Ubuntu Unity 16.04 LTS. If you have any Queries or if you find any difficulty in following the above steps then Kindly Comment Us and we will get back to you with a solution ASAP.

Article Review
  • Article Quality
  • Content Depth
  • Explanation
  • Working Efficiency


Visit TECROBUST for more interesting articles on Linux.

User Rating ( votes)
Check this too  Fix- Could not get lock /var/lib/dpkg/lock-frontend on Linux 18.04 LTS/ 19.10

Leave a Reply

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

Written by Ranger

Hey Guys, How you doing? I am Ranger and I am from Philadelphia. Actually, I am a very Lazy person with an active mind and a lazy body and mostly sleeping because of that. Foods and Places are my favorite and I would love to explore places. Contact me through the Contact Us page adding "@Ranger" on the Subject.

Best Linux Apps

Timeshift Linux- Install & Download on Linux Ubuntu Unity 18.04.1 LTS

The Best Linux Hacks

The Easy Hacks In Linux Using Command Line Codes, Command Line Hacks