So you want to change the name of a computer that is running Linux. Simple?
NOT… nothing is straight forward in Linux. Sure lots of programmers and IT developers will swear by Linux, but that doesn’t mean its straight-forward and neither is the documentation so spectacular either. Because so much of it is open-source you find all sorts of contradictory advice around the internet, and often it’s wrong anyway. So here is my attempt at contributing some consistency as I develop a few tutorials around some often encountered tasks.
This one is where you want to change the name of your Linux system so that when you look at your Local Area Network you will see the name of the computer rather than an IP address.
First you need to go to the file /etc/hosts. There you need to add (or change) the line
hosts 127.0.1.1 yoursystemname
Then you need to edit the file /etc/hostname and change the name to