Hostname fails to give FQDN

Jurjen Bokma

November 2010

The file/etc/hosts on an Ubuntu Lucid machine starts with: localhost.localdomain localhost somehost  somehost.mydomain somehost

and hostname -f gives:

jurjen@somehost:~$ sudo hostname
jurjen@somehost:~$ sudo hostname -f

According to Debian Bug 316099, the entry should exist. But its presence before the public range IP number hampers FQDN resolution. We remedy the situation by swapping the last two lines: localhost.localdomain localhost  somehost.mydomain somehost somehost


jurjen@comehost:~$ hostname
    jurjen@somehost:~$ hostname -f