How to Change Host Name in Ubuntu 16.04

Feb 26,2021 by Manoj Yadav
Inner banner

You may want to change the default hostname in Ubuntu16.04 for various reasons. It is not a cumbersome task and can be accomplished with a few proper steps. You must make changes to the file. The first step is to go the terminal.

$ sudo gedit /etc/hosts.

Press enter and the command opens the etc/hosts files in the default text editor. This is termed as Gedit in the Ubuntu. Since this is a system -level file, it cannot be changed by the users. To make changes you must use a sudo. (Sudo is a program for the UNIX Operating system by which a user can run programs using the security privileges of the user administrator).

You must login to your account. You will find 127.0.0.1 localhost and 127.0.0.1 dell-laptop-3344. Change the latter to some other name. Make changes in the file name that is linked to your IP address. Save, close and restart the system.

How to change the HostName in Ubuntu 16.04 without restarting:

$ sudo hostname xxxx

to change your hostname to ‘xxxx’ promptly. xxxx here is an example. You may choose any name you want. Do the changes in the same way in the /etc/hosts file. Done. You have successfully changed your hostname. The /etc/hosts will show the new name that you created whenever you login next.

Leave a Reply

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

Have questions?

Ask us.



    AWS Standard Consulting Partner

    • Go4hosting
    • Go4hosting

    Alibaba Cloud

    Go4hosting

    Go4hosting-NOW-NASSCOM-Member Drupal Reseller Hosting Partner

    Cyfuture Inc.

    7852 Percussion DR
    Apex, NC 27539
    Wake County

    Ph:   +1-919-802-6652
    E-mail:   us@cyfuture.com