Hi,
since upgrade to suse 11.3 every time I reboot pc the file /etc/hosts is reset to default value. I am a web developer so I need to put in there my aliases for 127.0.0.1. It is annoying to do it again and again. Luckily, I don’t restart my system very often but still I would like to avoid that.
What should I do to stop this resetting? Or is there another place in 11.3 where should I put my entries?
#
# hosts This file describes a number of hostname-to-address
# mappings for the TCP/IP subsystem. It is mostly
# used at boot time, when no name servers are running.
# On small systems, this file can be used instead of a
# "named" name server.
# Syntax:
#
# IP-Address Full-Qualified-Hostname Short-Hostname
#
127.0.0.1 localhost.localdomain localhost
# special IPv6 addresses
::1 localhost ipv6-localhost ipv6-loopback
fe00::0 ipv6-localnet
ff00::0 ipv6-mcastprefix
ff02::1 ipv6-allnodes
ff02::2 ipv6-allrouters
ff02::3 ipv6-allhosts
127.0.0.2 redBook.redBook redBook
This is the default value. However I want to change the line starting 127.0.0.1 to something like…
Not sure what’s doing that, may depend on your network settings, but you can work around it by binding those names for another loopback address, like this:
127.0.0.2 myweb1 myweb2 myweb3
In fact you can see an example of that in the file you posted. All the 2^24-2 addresses in 127.0.0.0/8 are equally good for a loopback address.
It may be netconfig that’s regenerating the lines so you may have to change it in YaST, and define an alias rather than change the localhost entry. I use ifup so I have control over /etc/hosts. Also things may have changed in 11.3, I’m still on 11.2 on this machine.
Where should I look for netconfig in Yast? I have openSuse in Czech language so the names are a little bit different. Btw I am using networkmanager for network configuration so there also might be a problem. However in 11.2 it worked nicely even with NM so something has changed probably.
Weird, I really don’t know why, but it DOES work! I used 127.0.0.2 instead of 127.0.0.1 and it doesn’t get removed after reboot. So thank you, problem solved