![]() sudo nano /etc/hostsĪfter editing and saving the files reboot your system. This configuration is important when the user wants to resolve some ip-address with the hostname. ![]() ![]() This file is used to map the hostnames to the IP address. In the same way, also edit the host file and change your existing hostname in that as well. To save the file press Ctrl+O, hit the Enter key, and then to exit use Ctrl+X. You will see your existing hostname in the file, just change it to whatever you want to set. However, after editing these configuration files the user has to restart the system to apply them. #2nd method: Edit /etc/hostname and /etc/hosts (reboot needed)Īnother method to change the name of your computer is by editing two files – /etc/hostname and /etc/hosts. To see the changes on your terminal, refresh the session: newgrp Well, if you want to change your hostname permanently without rebooting your Ubuntu Linux, then use the “hostnamectl set-hostname” command. Use hostnamectl set-hostname to change without rebooting (permanent) To see the changes, initialize your current environment or rerfersh your current session using: Replace the new one with the hostname you want to assign to your system temporarily. If you just want to change the hostname for temporary until your current session is not over or you have not logged out/rebooted your system use the given command in the terminal. #Ist method: Change Ubuntu 20.04 hostname for the current session only Your system will already have a pre-assigned hostname, let’s first check what is that? The command to print the current hostname on Ubuntu Linux is: hostname The given steps will also work for Ubuntu 22.04, 21.04, 19.04,18.04 Linux Mint, MX Linux, Rocky and other Linux systems. ![]() Ways to Change Hostname on Ubuntu 20.04 LTS via CLI or GUI Use GUI to Change Ubuntu 20.04 Hostname.Edit /etc/hostname and /etc/hosts (reboot needed).Use hostnamectl set-hostname to change without rebooting (permanent).Change Ubuntu 20.04 hostname for the current session only.Ways to Change Hostname on Ubuntu 20.04 LTS via CLI or GUI. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2023
Categories |