I changed my hostname in:


And then also changed it with:

sudo hostname MATRIX

But I experienced a problem because (and I don't know if this is related or not) none of my applications would launch, not even Terminal, the processes would launch, but just stay in the Sleeping status. So I restarted the machine and all seemed well until I ran something with sudo and I got this error message:

sudo: unable to resolve host MATRIX

Why is this the case and how can I fix it so that sudo can resolve it?

OS Information:

Description:    Ubuntu 15.04
Release:    15.04

Package Information:

  Installed: 1.8.9p5-1ubuntu5
  Candidate: 1.8.9p5-1ubuntu5
  Version table:
 *** 1.8.9p5-1ubuntu5 0
        500 http://gb.archive.ubuntu.com/ubuntu/ vivid/main amd64 Packages
        100 /var/lib/dpkg/status

You also need to edit /etc/hosts and look for your_hostname

You can also have a look at:

change the hostname without restart

change the computer name

  • and without sudo access, the only way to change /etc/hosts is either in recovery mode or from a live USB – Panther Jun 28 '15 at 15:31