Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: /etc/hosts reverting to previous version

  1. #1
    Join Date
    Jun 2008
    Location
    Kaneohe, HI
    Posts
    129

    Default /etc/hosts reverting to previous version

    This might be an issue with the platform, but thought I'd ask here first.

    I'm running 10.4 as a VirtualBox guest. I've edited within /etc/hosts the IP for a server I'm trying to connect to. However, every time I reboot it reverts to the previous version showing the old IP. I've edited the file manually as well as via YaST. Neither cements the changes.

    Before I go running to the VirtualBox forums, has anyone else ever encountered this?

    -Mathew

  2. #2
    Join Date
    Jun 2008
    Location
    Kaneohe, HI
    Posts
    129

    Default Re: /etc/hosts reverting to previous version

    Oops. 11.4, not 10.4.

  3. #3
    Join Date
    Jun 2008
    Location
    Earth - Denmark
    Posts
    10,730

    Default Re: /etc/hosts reverting to previous version

    On 10/04/2011 04:26 PM, theillien wrote:
    >
    > has anyone else ever encountered this?


    i'm confused about what application you are having problems with...do
    you think it is YaST, or whatever you used to edit /etc/hosts, or
    network manager, or ifup, or what?

    but, i'm also kinda confused about what you are trying to do...if you
    want to connect to a server from 11.4 running in a VM i don't understand
    why you want to put anything into /etc/hosts....i mean, how are you
    intending to connect: http? ftp? ssh? VNC? nfs? samba? telnet? hard wire
    via ethernet? wireless? which of those means/methods or protocols
    requires one to manually pre-load something into /etc/hosts?

    now, let me hasten to add that i'm no networking guru (i'm not even a
    breathing guru and i've done that for a LONG time) so, if you think
    maybe it is not an applications problem then why not post in the
    networking forum?

    --
    DD
    Caveat
    openSUSE®, the "German Automobiles" of operating systems

  4. #4

    Default Re: /etc/hosts reverting to previous version

    I would say that you're probaby using NAT (which is VirtualBox default). So the VirtualBox application on the host serves as a dhcp/router to the guest, and you didn't uncheck Change Hostname via dhcp as you installed the guest ... maybe. But you should setup VirtualBox to use bridge if you want a real network connection in both ways. I don't know how the guest can use network services on the host (except dhcp) without port forwarding... but I never use NAT. A bridge would be easier IMO. It would be indeed a question for the networking forum.

  5. #5
    Join Date
    Jun 2008
    Location
    Kaneohe, HI
    Posts
    129

    Default Re: /etc/hosts reverting to previous version

    @DenverD: You're making it far more complicated than it is. A file gets rewritten to a previous state every time I reboot. That's the issue. Nothing to do with connecting to network services.

    @please_try_again: Set to bridge already. I get my IP from our corporate dhcp.

    Clarification: It isn't the local hostname that is being change. The IP for another host is being reverted to a previous entry every time the VM is rebooted. I even took a snapshot of the running VM after the change was made and booting that snapshot still reverted.

  6. #6
    Join Date
    Jun 2008
    Location
    Earth - Denmark
    Posts
    10,730

    Default Re: /etc/hosts reverting to previous version

    On 10/04/2011 06:26 PM, theillien wrote:
    >
    > @DenverD: You're making it far more complicated than it is. A file gets
    > rewritten to a previous state every time I reboot. That's the issue.
    > Nothing to do with connecting to network services.


    there are several files associated with networking that are are affected
    by settings in config files...i don't know enough about networking to
    know what is deliberately removing and reverting to previous info...i
    think it could be something setup in YaST, or network manager or ifup or
    hosts.conf or whatever

    OR, it might be other things going on...i do not know... but i _think_ a
    networking guru would know....and it was therefore i suggested you ask
    in that forum..

    but, you are free to stay here and wait . . .

    --
    DD
    Caveat
    openSUSE®, the "German Automobiles" of operating systems

  7. #7
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: /etc/hosts reverting to previous version

    On 2011-10-04 18:26, theillien wrote:

    > Clarification: It isn't the local hostname that is being change. The IP
    > for another host is being reverted to a previous entry every time the VM
    > is rebooted. I even took a snapshot of the running VM after the change
    > was made and booting that snapshot still reverted.


    I don't remember seeing anything like that. There is a setting in config
    that makes it reorder the hosts file. Try disabling it, just in case.

    Mmm... I'm trying to find the setting, but I can't. YESS! Found it.

    /etc/sysconfig/suseconfig:
    BEAUTIFY_ETC_HOSTS="no"


    Other ideas:

    Check that the hosts file is really changed when you edit it.

    There is a trick to block modification of a file and learn what program is
    modifying it: apparmor. I have to find it, wait [...] this (from Cristian
    Rodríguez @ suse):


    Code:
    Date: Fri, 06 Mar 2009 12:04:21 -0300
    From: Cristian Rodríguez <  @suse.de>
    To: opensuse@opensuse.org
    Subject: Re: [opensuse] Who and why removes permissions to /dev/null ?
    
    
    
    try this:
    
    # auditctl -w /dev/null -p a
    # auditctl -e 1
    
    and then watch the logs...
    if auditctl is not found, when you execute it as root, install package
    "audit"

    In this case you don't put /dev/null, you put /etc/hosts. Read the man on
    auditctl first, I have never used that trick. Obviously, it only works with
    the system running - if it is VB who does the bad thing, I have no idea
    what you can do.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4 x86_64 "Celadon" at Telcontar)

  8. #8

    Default Re: /etc/hosts reverting to previous version

    Are you running dnsmasq?
    Code:
    sudo service dnsmasq status
    You can try to send a dhcp request with the verbose option. Maybe the dhcp server is doing that (?!)
    Code:
    dhclient -v <nic*>
    * for example, eth0

    IMO, it has nothing to do with VirtualBox. If you have a bridge, your vm is like any other computer in the lan. But you should check if other computers receiving an IP from this dhcp server also get /etc/hosts rewritten.

  9. #9

    Default Re: /etc/hosts reverting to previous version

    Quote Originally Posted by robin_listas View Post
    Other ideas:

    Check that the hosts file is really changed when you edit it.
    Yes, and if it is, send a dhcp request after editing/saving /etc/hosts and check again.

  10. #10
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: /etc/hosts reverting to previous version

    On 2011-10-05 03:16, please try again wrote:
    >
    > robin_listas;2390443 Wrote:
    >>
    >> Other ideas:
    >>
    >> Check that the hosts file is really changed when you edit it.
    >>

    >
    > Yes, and if it is, send a dhcp request after editing/saving /etc/hosts
    > and check again.


    You think that dhcp can publish /etc/hosts entries? It would be an
    interesting feature...

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4 x86_64 "Celadon" at Telcontar)

Page 1 of 2 12 LastLast

Posting Permissions

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