On Thu, Jun 16, 2011 at 2:32 AM, Tapas Mishra <mightydre...@gmail.com> wrote: > I've been having a problem where when our vps provider decides to > restart the server (running Debian 5.0.8), the server fails to > remember changes to /etc/hosts. All I need is an database alias that > is used for the webapps on the server which points to 127.0.0.1 > localhost. > > I want it to look like this: > > # The following lines are desirable for IPv6 capable hosts > # (added automatically by netbase upgrade) > > ::1 ip6-localhost ip6-loopback > fe00::0 ip6-localnet > ff00::0 ip6-mcastprefix > ff02::1 ip6-allnodes > ff02::2 ip6-allrouters > ff02::3 ip6-allhosts > > > 127.0.0.1 localhost.localdomain localhost webservice database > # Auto-generated hostname. Please do not remove this comment. > XXX.XX.XXX.XX xxxxxx.net.au xxxxxx www.xxxxxxx.net.au xxxxxxx
No. You don't You want this: 127.0.0.1 localhost.localdomain localhost 127.0.0.2 webservice database Trust me on this: it keeps NetworkManager from mucking with it, and will continue to focus your "webservice" traffic to the local network port. The overpopulation and auto-editing of "localhost" and 127.0.0.1 is an old problem. Your editing attempts, and what is probably NetworkManager's attempts to reset this "correctly", are conflicting Unfortunately, NetworkManager is, in my experienced and expert opinion, *crap*. It tries to do way too many things, and gets most of them wrong because it *does not publish its API*. It just tries to guess one based on other tool's common practices,and those differ by convention by distribution and environment and local policy. And it consistently gets them wrong for locally configured servers, as you just found out. Rip it out if possible: disable its init scripts if the dependencies force you to keep it around. -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/banlktikzfkjx_ykc22qjsekqybo6epb...@mail.gmail.com