you can change the names is two files .
1st , the file that @ducan12 mentioned
2nd , the file /etc/hosts.
Be careful to write the SAME name exactly.
I want to change the name of computer to MyComputer.
gksudo gedit /etc/hostname
Then I do
and change the 2nd line next to 127.0.1.1 (the first line is localhost) with MyComputer .
gksudo gedit /etc/hosts
So the contents of the file /etc/hosts will be
Reboot for the changes take effect.
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback