Monday, April 12, 2010

How to change hostname in Ubuntu (for Virtualmin)

In Ubuntu you can check your hostname with the command

hostname -f

And for the purpose of installing webmin, you would need a hostname that is searchable and resolve to your IP address.  Therefore you can set it by editing

sudo pico /etc/hostname
sudo pico /etc/host

and replacing the OLDNAME with the NEWNAME in these files. This will take effect after a reboot.  However to set it immediately, you can simply type

sudo hostname NEWNAME

this should fix your hostname, and it will be much easier to install Virtualmin

No comments: