You are not logged in.

#1 2010-11-09 16:30:41

fowler
Member
Registered: 2009-01-26
Posts: 152

hostname keeps being overwritten...

I have been trying to change my hostname from 'stupendiousman' to 'stupendousman'.

In my /etc/rc.conf I have...


# HOSTNAME: Hostname of machine. Should also be put in /etc/hosts
#
HOSTNAME="stupendousman"


In my /etc/hosts I have


# /etc/hosts: staticthe delay, but the refreshing issue came back.  It seems as though it didn't take the --indirect-rendering switch even though the wiki the delay, but the refreshing issue came back.  It seems as though it didn't take the --indirect-rendering switch even though the wiki  lookup table for host names
#

#<ip-address>   <hostname.domain.org>   <hostname>
127.0.0.1       stupendiousman  localhost.localdomain   localhost

# End of file

Which I change to:


# /etc/hosts: static lookup table for host names
#

#<ip-address>   <hostname.domain.org>   <hostname>
127.0.0.1       stupendousman  localhost.localdomain   localhost stupendousman

# End of file

However every time I reboot /etc/hosts changes back to the first one somehow.  Every time I change it something changes it back.
I have networkmanager installed... not sure if that's the problem.

Last edited by fowler (2010-11-29 13:48:30)

Offline

#2 2010-11-09 17:27:00

Bregol
Member
Registered: 2008-08-15
Posts: 175

Re: hostname keeps being overwritten...

fowler wrote:

I have networkmanager installed... not sure if that's the problem.

https://wiki.archlinux.org/index.php/Ne … t_hostname


Nai haryuvalyë melwa rë

Offline

#3 2010-11-10 17:18:06

fowler
Member
Registered: 2009-01-26
Posts: 152

Re: hostname keeps being overwritten...

Thanks.  I thought that nm was the problem.

Offline

#4 2010-11-10 19:50:42

Leonid.I
Member
From: Aethyr
Registered: 2009-03-22
Posts: 999

Re: hostname keeps being overwritten...

fowler wrote:

Thanks.  I thought that nm was the problem.

So, NM does overwrite /etc/hosts? Is this a reasonable behaviour?


Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd

Offline

#5 2010-11-10 20:04:07

Dogmeat
Member
From: Slovak Republic
Registered: 2009-02-24
Posts: 193

Re: hostname keeps being overwritten...

I had the same issue months ago on all compters where I used a networkmanager daemon. I solved it by the suggestion in the wiki page which Bregol mentioned. With the most recent update of networkmanager to 0.8.2 from testing repo it seems it overwrites /etc/hosts again but everything works in this case (in the past without properly configured /etc/NetworkManager/nm-system-settings.conf  networkmanager changed my /etc/hosts file and X applications weren't able to be launched).

From manually edited /etc/hosts:

127.0.0.1   localhost.localdomain   localhost acerntb

networkmanager 0.8.2 it changes to:

marek@acerntb ~ $ cat /etc/hosts
#
# /etc/hosts: static lookup table for host names
#

#<ip-address>   <hostname.domain.org>   <hostname>
192.168.1.19    acerntb # Added by NetworkManager
127.0.0.1       localhost.localdomain   localhost
::1     acerntb localhost6.localdomain6 localhost6
# End of file

Last edited by Dogmeat (2010-11-10 20:09:50)

Offline

#6 2010-11-25 14:10:33

Evilandi666
Member
Registered: 2010-10-28
Posts: 105

Re: hostname keeps being overwritten...

0.8.2-x has definitvly this bug and does not stop doing this when you config the nm-system-settings.conf right.

Does someone know how you stop NM  >=  0.8.2 overwriting the hosts file?

Offline

#7 2010-11-25 16:37:06

jvalecillos
Member
Registered: 2009-02-25
Posts: 24

Re: hostname keeps being overwritten...

This is not solved, with NetworkManager 0.8.2-5 seems to correct the change of hostname. But later i had problems with Mysql and when a check /etc/hosts file, i read this:

#
# /etc/hosts: static lookup table for host names
#

#<ip-address>    <hostname.domain.org>    <hostname>
10.25.25.99    gooru2    # Added by NetworkManager
127.0.0.1    localhost.localdomain    localhost    gooru    2
::1    gooru2    localhost6.localdomain6    localhost6

# End of file

The first line is the problem, should be:

10.25.25.99    localhost.localdomain    localhost gooru2

By the way, if you change that line and restart mysqld everything works fine, until you reboot the machine (o restart networkmanager o perhaps reconnect to the network).

Offline

#8 2010-11-26 11:03:48

Evilandi666
Member
Registered: 2010-10-28
Posts: 105

Re: hostname keeps being overwritten...

0.8.2-6 has this problem also ..  hmm

Offline

#9 2010-11-28 11:54:24

KlavKalashj
Member
Registered: 2008-10-09
Posts: 376

Re: hostname keeps being overwritten...

I have this problem too... also, why does it add the ::1 line? Google tells me it's for ipv6, but I tried in every way to disable ipv6. This problem is causing my gnome login to take about one minute, instead of 15 seconds.

Offline

#10 2010-12-01 16:15:40

gimireh
Member
From: Kathmandu, Nepal
Registered: 2010-11-13
Posts: 4

Re: hostname keeps being overwritten...

I had the same problem with the latest NetworkManager. I modified the nm-system-settings.conf and everything is working fine
but i had this problem that came with it. When i tried to download a file from browser firefox/chromium the speed was 40% of the actual speed (i'm using ADSL connection) but using terminal (wget) the speed is fine.

I search through different forums and found out this solution, This actually solved my speed problem too.

I removed all the lines added by NetworkManager and issued this command on /etc/hosts
sudo chattr +i /etc/hosts

making hosts file immutable NetworkManager is unable to alter it, well every time when i have to edit the hosts file i had to do
sudo chattr -i /etc/hosts and edit and +i again

i am happy with it till this issue is fixed. This may help others as well.


obssesed with changing distros .......................... ArchLinux is my doctor.

Offline

Board footer

Powered by FluxBB