• 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 Without Reboot

How To Change Hostname In Ubuntu Without Reboot

By Sourabh / June 2, 2023 Category: How To, Ubuntu

Learn how to change hostname in Ubuntu without reboot. Ubuntu users can change hostname via command line using hostname command.

Change Hostname Ubuntu Without Reboot via Commandline

Before you start to change the hostname, run the following command to check the current hostname of our system.

$ hostname

The ‘hostname’ command prints the name of the current host system (with no arguments).

You must also know about the ‘hostid’ command. The ‘hostid’ prints the numeric identifier of the current host in hexadecimal format.

When you run the commands with one argument, it sets the current host name to the specified string. (see below)

Now that we know the current hostname, you can change it using the hostname command. The sytnax of the command is “hostname NEW_HOSTNAME”.

To change the hostname to “SourceDigit”, run the following command:

$ sudo hostname SourceDigit

Using the above command you can change and set the new hostname as “SourceDigit”.

To change hostname using GUI, click settings, under setting window you can see the option labeled “Device Name” which shows the current hostname. Click this, erase the name and type your new hostname and press “Rename” button.

Run the hostname command to make sure that the changes are made correctly and the hostname is changed.

Primary Sidebar

Latest Posts

Delete Directory And Contents Recursively Without Prompt On Linux

Check User Login History In Ubuntu Linux Command Line

Use Locate Command To Find File In Linux Terminal By Name

How To Change Terminal Color In Ubuntu Command Line

How To Run Fsck Manually In Linux To Fix Unexpected Inconsistency

How To Fix Broken Packages On Ubuntu From Terminal

Re Execute The Previous Command In Linux Ubuntu Command Line

How Much RAM Is Needed For Ubuntu PC

How To Find Large Files And Directories In Linux Command Line

How To Use Clear Command History In Linux Terminal

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

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