Skip to content

5000+ Great Articles

Best Articles & Essays: Interesting Articles to Read Online

  • [Guide] How to Secure Windows 10 Windows 10
  • HDG Explains : How Does Google Chromecast Work? Product Reviews
  • Google Authenticator: What It Is and How to Set It Up Google Software/Tips
  • Fix Windows Update Error Code 8E5E03FA How-To
  • How to Fix “BOOTMGR is Missing” in Windows 10 How-To
  • Best ti-36x pro calculator 2020

    Best ti-36x pro calculator 2020. 1 - Texas Instruments TI-36X Pro Scientific Calculator, 16-Digit LCD Top Reviews Great

  • Is Apple Keychain The best password manager? General Software
  • How To Fix The Black Screen Of Death On Windows 10 Windows 10

Find and Change Your Hostname in Ubuntu

Posted on October 8, 2020 By blog_786 No Comments on Find and Change Your Hostname in Ubuntu

If you need to find out the name of your Ubuntu computer, this post shows you several ways to find it. We’ll also show you how to easily change the hostname. Ubuntu 17.x has a device name and hostname which appear to be different. The device name is displayed in the GUI and the hostname is displayed in the Terminal. I’ll show you how to change both.

Find your Ubuntu hostname

Your hostname can be found in several places. First of all, we’ll look at the Terminal window. To open a Terminal window, select Accessories | Terminal from the application menu. On newer versions of Ubuntu, such as Ubuntu 17.x, you need to click Actions and then enter terminal.

Your hostname appears after your username and the “@” symbol in the title bar of the Terminal window. In our case, our hostname is “ubuntu-virtual”. It also appears in the tooltip itself.

Find and Change Your Hostname in Ubuntu

This may seem redundant since the hostname is already displayed in the title bar and in the prompt, but you can also enter the following command to view the hostname.

– / $ hostname

Change Ubuntu hostname

There is a hostname file in the / etc directory that contains your hostname. This used to be the only way to change the hostname. Fortunately, there is an easier way. The easiest way to change your Ubuntu hostname is to just go to settings.

Depending on your version, this is the gear icon in the upper right corner of the screen, or the gear icon in the new dock. If the gear icon is in the upper-right corner, click About This Computer.

Find and Change Your Hostname in Ubuntu

If you needed to open “Settings”, scroll down to “Details” and click on it.

Find and Change Your Hostname in Ubuntu

When you click on “Details”, you will automatically be taken to the “About” screen. You will see an editable text box titled “Device Name”. Just enter the new hostname you want and hit Enter.

It’s worth noting that this method will permanently change the hostname, meaning you can restart and the new name will remain.

Edit hostname and host files

Edit hostname and hosts files

Another way to change the hostname is to open a Terminal window and enter the following command:

sudo hostname new-name

This will change the hostname, but upon restart it will revert to what is in the / etc / hostname file. If you need to change it permanently, you can edit the hostname file I mentioned earlier. To do this, open a terminal and enter the following command:

sudo vi / etc / hostname

Find and Change Your Hostname in Ubuntu

The file should contain nothing other than the hostname on the first line. In vi, you can enter insert mode by pressing the letter i. To delete characters, press the x key. You can also press the letter a to go into add mode. Note, to delete letters with x, you must first press ESC to exit insert or add mode.

After you change the name there, you will also need to change it elsewhere. Use the following command:

sudo vi / etc / hosts

Change the second line that starts with 127.0.0.1.

Find and Change Your Hostname in Ubuntu

After you change it in both of these locations, you can restart and the new name will remain. It should be noted that the name of the device in the settings will still show something else. So there seems to be a difference between the device name and the hostname. I’m not sure what the difference is and why it doesn’t update on the About page, but that’s what worked for me. Enjoy!

–

Share this:

  • Twitter
  • Facebook
Linux Tips

Post navigation

Previous Post: 3 Free Tools to Benchmark a Windows Gaming PC
Next Post: View the List of Services Hosted by the svchost.exe Process in Windows

Related Posts

  • Create Your Own Live Video Streaming Server With Linux Linux Tips
  • Gravel calculator Calculator
  • How to Install Ubuntu in VirtualBox Linux Tips
  • Back Up a Directory in Linux using a Shell Script Linux Tips
  • HDG Explains : What Is Sudo & Root On Linux? Linux Tips
  • BSD vs Linux: The Basic Differences Linux Tips

Leave a Reply Cancel reply

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

Archives

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

Categories

  • AI Tools & Guides
  • Amazon Web Services
  • Apple Watch
  • Computer Tips
  • Cool Websites
  • Featured Posts
  • Free Software Downloads
  • Gadgets
  • Gaming
  • General Software
  • Google Software/Tips
  • Hardware
  • Help Desk
  • How-To
  • iOS
  • iPad
  • iPhone
  • islamic Books
  • Linux
  • Linux Tips
  • Mac OS X
  • macOS
  • MS Office Tips
  • Networking
  • Office Tips
  • OS X
  • Product Reviews
  • Reviews
  • Safari
  • Smart Home
  • Smartphones
  • Software Reviews
  • technology
  • text
  • Tools Review
  • Troubleshooting
  • Tutorials
  • Uncategorized
  • Urdu Books PDF
  • Web Site Tips
  • Windows
  • Windows 10
  • Windows 7
  • Windows XP Tips
  • Wordpress
  • How to go Back to the old YouTube Layout (2013)
  • How to Bypass Chromecast DNS and Circumvent Geo Blocking
  • 5 Cool Websites to Find Good Movies and TV Shows on Netflix
  • SmartDNS vs VPN – What’s the Difference?
  • How to go Back to the old YouTube Layout (2017)
DMCA.com Protection Status

Recent Posts

  • How to Bypass Chromecast DNS and Circumvent Geo Blocking
  • 5 Cool Websites to Find Good Movies and TV Shows on Netflix
  • SmartDNS vs VPN “What’s the Difference?”
  • How to go Back to the old YouTube Layout (2013)
  • A Simple Trick to Get 50% Discount on Audible for Three Months

Recent Comments

  1. A Simple Trick to Get 50% Discount on Audible for Three Months on Private Browsing: What is it and What it is not
  2. 6 Best PayPal Alternatives (2017) on How to Save Money While Shopping Online in India
  3. Automatically Transcribe YouTube Video/Audio with Google Docs on 5 Best Team Management Apps (For Small and Large Teams)
  4. 6 Things You Need Know About Email Encryption on Delete All Emails from Gmail With Once Click
  5. Looking For YouTube Alternative? Try These 7 Video Sharing Sites on Ten Best YouTube Video Editing Software 2023
  • HTML Code to Wrap Text Around Image How-To
  • How To Block Websites On Windows Using The Hosts File How-To
  • Recover License Keys for Installed Software How-To
  • FIXING : External Hard Drive Not Mounting on macOS macOS
  • Fix Windows 7 Update Error Code 0x80070422 Windows 7
  • How to Get Dark Mode on WhatsApp for Android How-To
  • Online Dating Scammers: 10 Red Flags To Spot & Avoid Them Web Site Tips
  • Army Physical Fitness Test (APFT Calculator )

    Best apft standards .APFT Calculator.Soldiers have two minutes to complete because many sit-ups as possible. They must do all three events in the same

Copyright © 2023 How To Blog.

Powered by PressBook News WordPress theme

Go to mobile version