I was able to reproduce this on Ubuntu 8.10 with package hostname version 2.95. Results from terminal:
me@:~$ sudo hostname airhead sudo: unable to resolve host me@:~$ hostname airhead me@:~$ sudo hostname '' hostname: the specified hostname is invalid me@:~$ hostname
me@:~$
Contents of /etc/hostname me@airhead:~$ more /etc/hostname airhead me@airhead:~$
I was able to reproduce this on Ubuntu 8.10 with package hostname version 2.95.
Results from terminal:
me@:~$ sudo hostname airhead
sudo: unable to resolve host
me@:~$ hostname
airhead
me@:~$ sudo hostname ''
hostname: the specified hostname is invalid
me@:~$ hostname
me@:~$
Contents of /etc/hostname
me@airhead:~$ more /etc/hostname
airhead
me@airhead:~$