FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 03-20-2011, 06:04 PM
Chris G
 
Default How to stop Network Manager (I asssume) overwriting /etc/hosts in 10.10?

I have just upgraded from xubuntu 10.04 to xubuntu 10.10 but I think my
problem is also in ubuntu 10.10.

Network Manager (I assume) is overwriting my /etc/hosts file every time
I reboot my system. My /etc/hosts file is:-

127.0.0.1 localhost

# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters


... but Network Manager (or someone) insists on changing it to:-

127.0.0.1 chris localhost.localdomain localhost
::1 chris localhost6.localdomain6 localhost6

# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

Even if I make /etc/hosts read only by setting the permissions it
*still* gets changed!

This is totally broken for me because I have a proper domain for my
machine and another machine on my LAN provides DHCP and DNS services
including the domain name. With the above Network Manager changes I no
longer have a valid domain and both apache2 and leafnode (among others)
complain about my system not having a valid domain until I remove the
above changes and restore my (simpler and more correct) /etc/hosts.

I believe this bug has been reported but I need a workaround to prevent
getting screwed up every time I restart my system.

--
Chris Green

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 03-20-2011, 06:49 PM
Tom H
 
Default How to stop Network Manager (I asssume) overwriting /etc/hosts in 10.10?

On Sun, Mar 20, 2011 at 3:04 PM, Chris G <cl@isbd.net> wrote:
>
> I have just upgraded from xubuntu 10.04 to xubuntu 10.10 but I think my
> problem is also in ubuntu 10.10.
>
> Network Manager (I assume) is overwriting my /etc/hosts file every time
> I reboot my system. *My /etc/hosts file is:-
>
> * *127.0.0.1 * * * localhost
>
> ... but Network Manager (or someone) insists on changing it to:-
>
> * *127.0.0.1 * * * chris * localhost.localdomain * localhost
>
> Even if I make /etc/hosts read only by setting the permissions it
> *still* gets changed!
>
> This is totally broken for me because I have a proper domain for my
> machine and another machine on my LAN provides DHCP and DNS services
> including the domain name. With the above Network Manager changes I no
> longer have a valid domain and both apache2 and leafnode (among others)
> complain about my system not having a valid domain until I remove the
> above changes and restore my (simpler and more correct) /etc/hosts.

I find it surprising that "chris" is added to the "127.0.0.1" line.
The debian developers has many "discussions" in this respect and
decided to have a "127.0.1.1" line for the hostname of a dhclient box.

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?

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 03-22-2011, 08:22 PM
Tom H
 
Default How to stop Network Manager (I asssume) overwriting /etc/hosts in 10.10?

On Tue, Mar 22, 2011 at 4:37 PM, NoOp <glgxg@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

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 

Thread Tools




All times are GMT. The time now is 01:03 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org