How to stop Network Manager (I asssume) overwriting /etc/hosts in 10.10?
Tom H
tomh0665 at gmail.com
Tue Mar 22 21:22:00 UTC 2011
On Tue, Mar 22, 2011 at 4:37 PM, NoOp <glgxg at sbcglobal.net> wrote:
> On 03/21/2011 02:56 AM, Chris G wrote:
>> On Sun, Mar 20, 2011 at 03:49:55PM -0400, Tom H wrote:
> ...
>>> I have a 10.10 install where NM prepends a line within "/etc/hosts"
>>>
>>> <begin>
>>> dhcp_ip_address hostname # Added by NM
>>> 127.0.0.1 localhost.localdomain
>>> 127.0.1.1 hostname
>>> </end>
>>>
>>> Change "/etc/hosts" to
>>>
>>> <begin>
>>> 127.0.0.1 localhost
>>> 127.0.1.1 chris.yourdomain chris
>>> </end>
>>>
>>> to check whether it's mis-edited.
>>>
>>> What's "cat /etc/hostname"?
>>>
>>> Is it "chris"? Does changing it to "chris.yourdomain" resolve your problem?
>>>
>> It's the fact that Network Manager insists on adding "127.0.0.1
>> localhost.localdomain" that causes me a problem. Both apache2 and
>> leafnode complain when finding that the domain name is localdomain.
>>
>> I have solved the problem for the moment simply be uninstalling Network
>> Manager and installing wicd instead, that leaves everything as I want it
>> but gives me a GUI interface to look at things still.
>
> https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/659872
The OP's problem's easy to solve without uninstalling or not using NM;
or making "/etc/hosts" immutable.
For 10.04:
cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 myhost.mydomain myhost
cat /etc/hostname
myhost.mydomain
For 10.10:
cat /etc/hosts
[dhcp_ip_address myhost.myhomain myhost # Added by NM]
127.0.0.1 localhost.localdomain localhost
cat /etc/hostname
myhost.mydomain
More information about the ubuntu-users
mailing list