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.
- Change Hostname in Ubuntu[Temporary] using Terminal
- Example of the Command
- Change Hostname in Ubuntu[Pernament] using GUI Mode
- Get in Touch with Us
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.
- 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.
- Use the Command sudo hostname Orange-red and Press Enter Key.
- You will be asked to enter Password to execute the Command. Kindly enter the Password and press Enter key.
- Now you can find the Hostname changed and will be reflecting your Linux Terminal as well as System Settings.
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.
- Click on All Applications.
- Scroll down and Locate Settings from the menu.
- Once you find the Menu Click and Open it.
- When the Settings panel opens, you will find Details at the Bottom of the Left pane. Click on the Details and Open it.
- It will display the System Information where you will find the Hostname(Device name).
- All you have to do is simple. Change the Device name with your New Hostname and press Enter Key.
- 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.