I try to use Debian everywhere. Not because I think it's perfect, but it's close. But if I had to point out one misdesign that I hate, it would be the fact that applications care about the contents of /etc/hosts.
If I don't put the FQDN on the line containing 127.0.0.1 in /etc/hosts, then one set of (proprietary) applications stops working.
If I do put the FQDN on the line containing 127.0.0.1 in /etc/hosts, then another set of (proprietary) applications stops working.
I want to kill people.
I've been considering writing a custom NSS module which changes the
return value of gethostbyname()
and friends depending on who's calling
the function. That would be ugly, but I suppose it could work. But I
really, really, really don't want to start doing this.
Grrr.
Have you tried with and FQDN and varying the order too?
192.0.2.1 myhost myhost.mydomain 192.0.2.1 myhost.mydomain myhost
You might be lucky and one of the applications might look at only the first/last entry on a line.
I think it's best to assume those applications are completely broken (e.g. they parse /etc/hosts themselves) than that they are partially broken. So I doubt an NSS module will work.
The same goes for applications that only work with DES style /etc/shadow or applications that only work (fortunately only during installation) with LDAP disabled.
N.B. What is the proper format for the localhost line anyway? Just "127.0.0.1 localhost" seems correct to me?
You should name these sets of applications, so the developers can a) feel ashamed, and b) fix the problems.
Alternatively, so c) people can avoid installing those applications.