• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Source Digit

Source Digit

Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos

  • Home
  • How To
  • Ubuntu
  • Instagram
  • Blogging
  • Android
  • WordPress
  • +More
    • Cloud Computing
    • Gadgets
    • Social Media
    • Technology
  • Write for Us
Home / How To / How to Change Hostname in Ubuntu 14.04 Terminal Screen

How to Change Hostname in Ubuntu 14.04 Terminal Screen

By Sourabh / May 6, 2015 Category: How To, Ubuntu

How to change Hostname (Computer Name) in Linux Ubuntu 14.04. You can change the Hostname or Computer name in Linux Ubuntu PCs. This trick to change the Computer Name also applies for other Linux Ubuntu derivatives.

The default Hostname (Computer Name) is set during the Linux Ubuntu instalation. Let us see how can we easily change the Hostname (Computer Name) by editing the hosts and hostname files in Linux Ubuntu.


Change-Hostname-Ubuntu

Find Hostname in Ubuntu

Hostname Command: Hostname is used to either set or display the current host or domain name of the system. This name is used by many of the networking programs to identify the machine. The domain name is also used by NIS/YP.

Find Hostname in Ubuntu: When called without any arguments, the program displays the current names. Run the command “Hostname” (without quotes) to display the current Hostname.

Edit Your /etc/hostname File

Ubuntu and other Debian-based Linux distros store the hostname in /etc/hostname. Open Terminal and run the following command to edit the /etc/hostname file.


sudo gedit /etc/hostname

To change the /etc/hostname file entry, just delete the existing hostname and write your new hostname and then save the text file.

Edit Your /etc/hosts File

The Hostname (Computer Name) is also stored in the /etc/hosts file. You’ll need to change the hostname in your /etc/hosts file. Run the following command to open the /etc/hosts file:


sudo gedit /etc/hosts

Search the old hostname in the hosts file. The hostname in the /etc/hosts file looks like:

127.0.1.1 YOUR-HOSTNAME

To change the /etc/hosts file entry, just delete the existing hostname and write your new hostname and then save the text file.

Thats’ it, but the change won’t take effect immediately. You must reboot (restart) the system to change it immediately. You can also use the hostname command.

Change Your Hostname Immediately

The change the hostname immediately without restart, use the hostname command in a terminal:


sudo hostname your-new-hostname

or

sudo /etc/init.d/hostname.sh start

Your computer’s hostname will be changed immediately. Close the Terminal, if open to reflect the new name.

Tags: Change Computer Name Linux Ubuntu, Change Default Username in Ubuntu, Change hostname in Ubuntu permanently, Change hostname in Ubuntu Server, Change Hostname Linux Ubuntu, change the hostname Ubuntu without a restart?, Change Your Computer Name in Ubuntu, How to Change Computer Name in Ubuntu 14.04, How to Change Hostname in Ubuntu 14.04, How To Change Your Computer Name, Linux, Ubuntu 14.04

Primary Sidebar

Latest Posts

Free AI Courses With Certificate For Beginners In India

Best AI Plugins For WordPress To Use In 2026

3 Commands To Check USB Connection In Linux Terminal

Linux Terminal Commands for Beginners With Examples

How To Password Protect A Folder In Linux Command Line

Best Download Managers for Ubuntu Linux (2026 Edition)

5 Best Free Keyword Research Tools for Bloggers in 2026

How To Check Linux 32 or 64-Bit Command Line

How To Delete And Remove Repository In Ubuntu Terminal

Fix Unexpected Inconsistency By Running Fsck Manually From Initramfs

© 2026 Source Digit • Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos

  • Home
  • About
  • Privacy Policy
  • Terms & Conditions
  • Contact Us
  • Sitemap