Unable to resolve hostname supernova

This happens when the hostname as specified in /etc/hostname is not linked to localhost ip 127.0.0.1

Solution:

First get the current hostname:

[email protected]:~$ cat /etc/hostname
supernova

Next, add a line for this hostname in hosts file.

sudo emacs /etc/hosts

The new line is this:

127.0.0.1 supernova