Debian and localhost.localdomain

by Juliet Kemp

A while back I was trying to set up kpropd on a Debian system, and came across a problem whereby one of my hosts was identifying itself as host/localhost.localdomain (this was Not Helpful).

Investigation revealed firstly that hostname returned the correct thing (i.e. servername), and secondly that /etc/hosts looked like this:

x.x.x.x  servername    localhost.localdomain  localhost  servername

There has been discussion on the Debian lists about the order of this last line being incorrect; some applications (including, it seems, at least some aspects of Kerberos admin) can't cope with returning localhost.localdomain instead of localhost.

Replacing that last line with    localhost  localhost.localdomain  servername
solved the problem - i.e. localhost.localdomain wants to be an alias, not the canonical hostname.

(Note: this was using a sarge system (and in fact I was working on this quite some time ago); I don't know what the current situation is with etch, nor whether it has been fixed in recent sarge bugfixes. Just documenting it in case others encounter the same/similar problem.)


2007-01-18 12:45:52
Thanks, Fun little Debian tidbit.
jeremiah foster
2007-01-24 05:42:24
Hmm. Ubuntu does the same thing: localhost.localdomain localhost

Not surprising really because Ubuntu is a debian clone.

2007-01-25 06:31:16
Hmm. Fedora Core 5 appears to do the same thing too.
2007-02-21 16:32:18
Many thanks, it helped me!
2007-04-22 11:10:58
I probably should not post, my Debian experience being sporadic.
I have installed etch from DVD. If I put localhost.localdomain in Epiphany, I am directed to a Charter communications websearch (which is how I got this link). Typing however brings me to /var/www/apche2-default/, where I have placed all my web pages, prior to migration from Yahoo.
Typing also brings me to apache2-default.
My /etc/hosts contains these lines: localhost localhost
My real goal though is how to configure my name server. I am still sifting through the Etch instructions and release notes.