If I open a terminal windows in my graphical user interface, hostname command result is different from content of /etc/hostname:
me@ZyXEL1:~$ hostname
ZyXEL1
me@ZyXEL1:~$ cat /etc/hostname
N4010
me@ZyXEL1:~$ cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 N4010
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
and sudo command shows:
sudo: unable to resolve host ZyXEL1: No such file or directory
In tty1, tty2 and ... the command prompt is me@N4010:~$ instead of wrong one: me@ZyXEL1:~$, but sudo result is same as terminal window:
me@N4010:~$sudo
sudo: unable to resolve host ZyXEL1: No such file or directory