Thursday, October 9, 2014

Change Fedora Hostname

ที่มา - http://www.labtestproject.com/using_linux/permanently_change_hostname_on_fedora

Change Fedora Hostname for current session.

   On the installation process of Fedora, you named you Fedora machine.  Then one Monday morning you decide to change the hostname to something else.  The step by step procedure below show the simples way to change hostname on Fedora machine temporary.

1.  Display your fedora box hostname by execute the hostname command.
[root@localhost ~]# hostname
localhost.localdomain

2.  To change Fedora hostname execute the hostname command as example below.
[root@localhost ~]# hostname fedora.labtestproject.com

Please note: That with the hostname command, the hostname only for the session only... the hostname reset back to the previous state after you reboot the system.
Change Fedora hostname permanently.

   On Fedora, to change the hostname permanently you need to edit the network configuration files.  The step below show the way to change hostname by using network configuration tools, and then verify the changes on the hostname configuration files.

1.  Backup the network configuration files:
[root@localhost ~]# cp -pr /etc/sysconfig/network /etc/sysconfig/network.bak

2.  Display the hostname configuration file:
[root@localhost ~]# cat /etc/sysconfig/network
NETWORKING=yes 
HOSTNAME=localhost.localdomain 

3. Modify hostname
[root@localhost ~]# vi /etc/sysconfig/network
NETWORKING=yes 
HOSTNAME=newhostname 

4. Reboot fedora

No comments:

Post a Comment