[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#267321: Debian installer and /etc/hosts




Seems to me that this behaviour Thos proposes is thoroughly broken. Several times I've had problems because the host name resolves to the wrong address.

I'll go further too and propose that sudo's hehaviour is broken. It should not be trying to resolve $HOSTNAME if there's no external network: note that if there's no external network that implies the user has local access. Test rules for 127.0.0.1 by all means.

The brokenness of sudo is no reason to break even more software.

If there is no external network, then the behaviour of programs such as ping, telnet, ssh are irrelevant. All are of limited use without a functioning network.



Thomas Hood wrote:

On Sun, 2004-08-22 at 22:37, VSJ wrote:
I'd go for the following solution:

[... not to include the hostname as an alias for 127.0.0.1
if the network is configured via DHCP.]

I am beginning to think that we should bite the bullet and do one of
two things.  Either,

1. to require software to work even if <hostname> cannot be resolved,

or,

2. to make the following a standard entry in /etc/hosts:
      127.0.1.1   <hostname>


Repeating myself from #247734 ...

I think we should continue to consider the alternative of having:

   127.0.0.1	localhost.localdomain	localhost
   127.0.1.1	<hostname>

when there is no static IP address we can use instead of '127.0.1.1'.

The advantage of this configuration is that localhost.localdomain is
the canonical hostname for the standard loopback address -- the address one gets if one looks up 'localhost', and <hostname> is the
canonical host name for the address one gets if one looks up
<hostname>.

I don't think that there are many disadvantages.  All sudo wants is that
the hostname be resolvable; the address to which the hostname resolves
doesn't have to work.  There may be other programs that want to resolve
the hostname and also use it and for that reason it seems safest to make the hostname resolve to a 127.* address. 127.0.1.1 works as well
as 127.0.0.1 for some services: I have tried ping, telnet, ssh and
name lookups using dnsmasq and they all work at 127.0.1.1.  If there
are services for which 127.0.1.1 fails to work then we will either have
to modify those services or tell people not to access those services via
<hostname> but via 'localhost'.
--
Thomas





--

Cheers
John

-- spambait
1aaaaaaa@computerdatasafe.com.au  Z1aaaaaaa@computerdatasafe.com.au
Tourist pics http://portgeographe.environmentaldisasters.cds.merseine.nu/




Reply to: