Comment 3 for bug 19775

Revision history for this message
Dani Alonso (dalonso) wrote : Re: Missing hostname in /etc/hosts

I can confirm the bug being present in dapper. Nevertheless the fix Vincent proposed is not enough.

In fact, /etc/hosts has two diferent layouts depending on the computer is being connected to a network or not.

Case 1: No network. Should read only 1 line:

127.0.0.1 localhost.localdomain localhost myhostname

Case 2: Network. Should read 2 lines:

127.0.0.1 localhost.localdomain localhost
x.x.x.x myhostname

where x.x.x.x is the ip assigned to the interface.

In fact, dhclient3 should be responsible of updating /etc/hosts every time a new lease is acquired over the default network interface.