« HOWTO Enlarge A VMware DiskHOWTO get a Packard Bell scanner working. »

HOWTO To Change The Hostname

26/07/08

HOWTO To Change The Hostname

So for whatever reason you need to change the hostname of your Fedora Linux machine. For me this is usually because I am playing around with a virtual machine. I have automated the setup of a generic machine installation the name always ends up as "generic".

...

Check your host name is set to something and no errors are returned. The commands below will return the host name with an without the domain.

uname -a 


uname -n 
hostname -a 
hostname -f

To change the hostname temporarily use the hostname command, and assuming you use the variable substitution in the network config for your NIC this will also change when you restart the network service. See my HOWTO: Handcraft Network Configurations

For a temporary name change
sudo hostname newname.example.com
sudo service network restart

To change the hostname permanently you will also need to change the value of HOSTNAME in /etc/sysconfig/network

sudo nano /etc/sysconfig/network
/etc/sysconfig/network
HOSTNAME=<new name in here>
sudo service network restart

now when you reboot the name will be changed

sudo reboot

Once the machine has rebooted use check that the new name is set correctly

uname -a 


uname -n 
hostname -a 
hostname -f

There you go all done!


No feedback yet

Here are a collection of Mini-HOWTOs some of which are too short even for that grand title. I keep them around as it is easier to remember where to look these up that to remember the content of the mini-HOWTO

Search

Contents

powered by b2evolution free blog software