How to change Host name in RH Linux
Hi,
I installed Red Hat Linux and need to change the Host name using linux command line way .when i newly installed and configured, it displayed as - [root@localhost root]#
This was the default provided by system, can you all help me chnage this in the following format - [root@pc1 root]#
Is there any way to change host name?
How to change Host name in RH Linux
Why not, This is very simple procedure to change it from the command line argument and you have to restart the computer to get the changes after issuing command from the command line argument :
Code:
#hostname Desired_Name
It is possible in case only, if you are the root user of the linux system and update theses changes in network file also.
How to change Host name in RH Linux
For permanent changes in the configuration of linux host name, you need to have the privilege of root user and open up the network file from the following location in Vi editor -
Code:
[root@localhost root]#cd /etc/sysconfig/
[root@localhost root]# vi network
And edit the following parameter with proper information in the configuration file for host related queries by the system -
Network type :
Hostname :
Gateway :
How to change Host name in RH Linux
Hello sir,
I issued the command and edit the network configuration file and then restart Linux computer. After all of the operation, it is abusing me like -
"Could not look up internet address for PC1.localdomain.
This will prevent GNOME from opening correctly.
it may be possible to correct the problem by adding PC1.localdomain to the file /etc/host.
Any other procedure or trick to solve this or my PC is going to corrupt. Please help me
How to change Host name in RH Linux
hello dear,
You are about to change the host name, something is going to left. You need to edit the hosts file also located in /etc/hosts.
Just open it with vi and fill the appropriate value for the dedicated parameter and in case if the old name is already tagged there then replace the old host name and fill up your new host name. Now save the changes and restart your PC. The error would not be displayed for you.
Thanks