• Skip to main content
  • Skip to secondary menu
  • Skip to primary sidebar
  • Skip to footer
WebSetNet

WebSetNet

Technology News

  • Technology News
    • Mobile
    • Games
  • Internet Marketing
  • System Admin
    • Windows 11
    • Linux
    • Mac & Apple
    • Website Scripts
      • Wordpress
You are here: Home / System Admin / Linux / How to Change Computer Name (hostname) in Ubuntu 22.10 without Restart

How to Change Computer Name (hostname) in Ubuntu 22.10 without Restart

October 21, 2022 by jerry23

This simple tutorial shows how to change the computer name (aka hostname) in your Ubuntu 22.10 Kinetic Kudu without a system restart.

The methods here are universal ways that works in not only default Ubuntu release but also its flavors (e.g., KUbuntu, XUbuntu), and even other Linux.

NOTE: A hostname can be a single word or phrase, including letters, number, periods, or hyphen with 253 characters length limit, with NO space.

Change Computer Name for Temporary Use

If possible to change the name for temporary use. So, the new name will work until you restart the system.

  • To do so, simply open terminal or connect to command console and run command:
    sudo hostname NEW_NAME_HERE

Replace ‘NEW_NAME_HERE’ and type user password (no asterisk feedback) to authenticate. And, you may need to restart terminal or console to see effect.

Change Computer Name by Editing Config file

The classic way to permanently change your system hostname is just edit the configuration file!

Ubuntu 22.10 switched to Gnome Text Editor instead of Gedit. The new editor however does NOT open files via sudo command from terminal, due to either bug or design issue.

So, here I’m going to use the universal nano command line text editor to open the configuration file.

  • To do so, open terminal and run command:
    sudo nano /etc/hostname

When file opens in terminal, delete the old name and type a new one. Finally, press Ctrl+X, type y and hit Enter to save change.

This method however need a system restart if you’re running with default Wayland session. If you switched back Xorg session, run the command below to make it work without restart.

sudo systemctl restart systemd-logind.service

Use ‘hostnamectl’ to change computer name

The hostnamectl command is a good choice today to permanently change your computer name without system start.

  • As easy as the first method, just run command in command/console:
    hostnamectl hostname NEW_NAME_HERE

The change takes effect immediately, though you may need to restart terminal window.

Use new name in ‘/etc/hosts’

To avoid network issues, it’s HIGHLY recommend to also edit ‘/etc/hosts’ and replace all old names with new ones.

  • Open terminal and run command to edit the file:
    sudo nano /etc/hosts

When file opens in terminal, delete all the old hostname and insert the new name you set. Also, press Ctrl+X, type y and hit Enter to save change.

Original Article

Twitter Facebook Pinterest Linkedin WhatsApp

Related posts:

  1. How To Change Hostname In Ubuntu Using Command Line
  2. 21 Basic Linux Networking Commands You Should Know
  3. Essential command tools to fix virtually any networking issue on Windows 10
  4. Amazon Alexa Easter eggs: Over 180 funny things to ask Alexa
  5. Lenovo ThinkPad X1 Nano Review: Crazy light, but also crazy good
  6. 5 Tweaks to Customize the Look of Your Linux Terminal
  7. How to change the hostname on CentOS and Ubuntu
  8. Linux Nano editor explained for beginners (10 examples)
  9. Running your first batch script on Windows 10
  10. Install Moodle eLearning Platform on Debian 9

Filed Under: Linux Tagged With: change, computer, name, restart, Ubuntu, without

Primary Sidebar

Trending

  • FIX: Microsoft Store error code 0x80d02017
  • How To Extract & Install tar.gz Files In Ubuntu
  • Exclamation Mark on Network Signal, Mobile Data Not Working? 8 Ways to Fix
  • 8 Best Sites to Read Manga Online for Free
  • 3 Ways to Disable GetApps on Xiaomi, Redmi, and Poco Phones Running MIUI
  • How to find a lost Apple Pencil using your iPad (1st and 2nd gen)
  • How to Track a Stolen or Lost Nintendo Switch
  • Microsoft Edge’s newest feature? Shopping in Microsoft Edge
  • How to lock Shape, Image or Objects in Microsoft PowerPoint
  • How To Fix No Sound On YouTube
  • 7 Ways to Save an Image From Google Docs
  • How Much Data is Consumed by Zoom, Google Meet, Skype, Microsoft Teams, Slack and Hangouts?
  • How to Make Any Wired Printer Wireless in 6 Different Ways
  • Samsung TV model numbers explained 2022: What you need to know about Samsung’s OLED, Mini LED, QLED and LCD televisions
  • 5 Best Sites To Play Scrabble Online With Friends
  • 192.168.1.1 Login, Admin Page, Username, Password | Wireless Router Settings
  • 7 Simple Ways To Free Up Space On Ubuntu and Linux Mint
  • How To Enable Or Disable Snipping Tool In Windows 10

Footer

Tags

Amazon android Apple Asus available download: edge feature features first free from galaxy Game games gaming gets google install Intel iPhone launches linux Microsoft more OnePlus phone release released review: samsung series support this Ubuntu update using video watch what will windows with xbox your

Archives

  • December 2023
  • November 2023
  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org