Results 1 to 4 of 4

Thread: How to prevent NetworkManager from modifying '/etc/hosts'?

  1. #1
    Join Date
    Aug 2010
    Beans
    22

    How to prevent NetworkManager from modifying '/etc/hosts'?

    Latest NetworkManager adds the following line into my '/etc/hosts':
    192.168.0.1 <my_hostname>

    Because of that some applications can't properly create sockets as they expect hostname to be mapped to 127.0.0.1 (e.g. Mainsoft Mainwin-based apps).

    Is there any way to prevent NetworkManager from modifying '/etc/hosts'?

    Thanks in advance!

  2. #2
    Join Date
    Jan 2006
    Location
    Not heaven... Iowa
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: How to prevent NetworkManager from modifying '/etc/hosts'?

    Curious - my Lucid machine doesn't touch the file - but I have 127.0.1.1 defined with the hostname (127.0.0.1 is defined as "localhost").
    Linux User #415691 Ubuntu User #8629
    Iowa Team (LoCo): [Wiki] [Launchpad] [Sub-forum]
    IRC channel: #ubuntu-us-ia on irc.freenode.net

  3. #3
    Join Date
    Aug 2010
    Beans
    22

    Thumbs down Re: How to prevent NetworkManager from modifying '/etc/hosts'?

    Well, it's on Ubuntu 10.10 Maverick Meerkat.
    Actually this is an intended behavior of the latest NetworkManager, for some reason it's considered to be a bad habit to alias computer hostname to localhost but I need it for the CAD software I use.
    For now I made quick'n'dirty fix: manually edited '/etc/hosts' as I needed and set a read-only attribute to it. Now NetworkManager can't change it. But it would be great to know an 'official' solution for that.
    Last edited by cioma; September 27th, 2010 at 06:54 PM.

  4. #4
    Join Date
    Aug 2009
    Beans
    3

    Re: How to prevent NetworkManager from modifying '/etc/hosts'?

    have the same problem. Software which is based on lmgrd don't work

    I don't have seen that by rfc952 a sorted order of ip adresses must be given or that 127.0.0.1 must be always on top of the list.

    So why does it matter?

    And If network manager must add something to the list, why is it on top can't it be on bottom?

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •