← Back to team overview

desktop-packages team mailing list archive

[Bug 659872] Re: Aliases in /etc/hosts overwritten

 

** Tags added: testcase

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to network-manager in Ubuntu.
https://bugs.launchpad.net/bugs/659872

Title:
  Aliases in /etc/hosts overwritten

Status in “network-manager” package in Ubuntu:
  Fix Released
Status in “network-manager” source package in Maverick:
  Won't Fix

Bug description:
  Binary package hint: network-manager

  ---
  WORKAROUND:
  You can use aliases against another loopback address in the 127.x.y.z range, such as 127.1.1.z. Addresses within 127.0.y.z are rewritten by NM.
  ---
  SRU JUSTIFICATION:
  In its current state NetworkManager overwrites static entries placed in /etc/hosts, users requiring such aliases for Apache servers or whatnot cannot add them (except using the workaround above). This constitutes a regression from the Lucid release, as well as somewhat of an issue for upgrades.

  This has been addressed in natty by cherry-picking a patch from the
  upstream stable git branch which corrects the issue: looking for
  entries not matching the known hostname and skipping them.

  Regression potential is medium/low: users with the patch, in the event
  it was to break, would lose alias entries, or possibly the hosts entry
  for the interface's IP. However, standard loopback/localhost entries
  remain and are ignored.

  TEST CASES:
  1) Add a custom entry to /etc/hosts sending to the loopback address. e.g.

  127.0.0.1 toto123

  2) Click on nm-applet, then the already-establish connection to have
  it re-negotiated.

  In the current version in maverick, network-manager removed the entry.
  With the patch applied, the entry is left intact.

  ---

  I develop several web sites on my laptop, and each one is a different
  virtual host through Apache.  Until Lucid, I was able to alias these
  hosts in /etc/hosts, like this

    127.0.0.1 localhost localhost.localdomain myhost1.localdomain
  myhost2.localdomain myhost3.localdomain

  Starting with Maverick, however, NetworkManager overwrites the
  127.0.0.1 line every time it initiates a new network connection, so
  these aliases are lost.  It is fair to argue that aliasing 127.0.0.1
  isn't ideal, but as far as I can find, NetworkManager doesn't offer
  any alternative for aliasing the bound IP address.  For example, if I
  connect to WiFi, it adds a line like

    192.168.0.101 snape

  There seems to be no way to get it to do

    192.168.0.101 snape myhost1.localdomain myhost2.localdomain
  myhost3.localdomain

  NetworkManager should not overwrite the 127.0.0.1 line in /etc/hosts
  until there is an alternative method available for aliasing on the
  local machine, without setting up an entire local DNS server.

  ProblemType: Bug
  DistroRelease: Ubuntu 10.10
  Package: network-manager 0.8.1+git.20100810t184654.ab580f4-0ubuntu2
  ProcVersionSignature: Ubuntu 2.6.35-22.34-generic 2.6.35.4
  Uname: Linux 2.6.35-22-generic x86_64
  NonfreeKernelModules: fglrx wl
  Architecture: amd64
  CRDA: Error: [Errno 2] No such file or directory
  Date: Wed Oct 13 08:22:07 2010
  Gconf:

  IfupdownConfig:
   auto lo
   iface lo inet loopback
  InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release Candidate amd64 (20100928)
  IpRoute:
   192.168.0.0/24 dev eth0  proto kernel  scope link  src 192.168.0.198  metric 1
   169.254.0.0/16 dev eth0  scope link  metric 1000
   default via 192.168.0.1 dev eth0  proto static
  Keyfiles: Error: [Errno 2] No such file or directory
  ProcEnviron:
   PATH=(custom, user)
   LANG=en_CA.utf8
   SHELL=/bin/bash
  RfKill:
   0: hp-wifi: Wireless LAN
    Soft blocked: no
    Hard blocked: no
  SourcePackage: network-manager

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/659872/+subscriptions