Hosts file changes after each reboot

Discussion in 'General' started by ledzgio, Feb 9, 2014.

  1. ledzgio

    ledzgio New Member

    Hi all,

    each time I reboot my server the file "/ect/hosts" changes (I lost my modifications) and then amavis stops working.

    How can I make permanent modifications to hosts file? is there any server that changes it at each reboot?

    thank you
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    ISPConfig is not changing this file, so I guess you use a vm and the virtualisation enviroment resets the hosts file. Either you talk with your hoster so that they add the correct hostname in the virtualisation software or you modify the amavisd config file and set the full hostname permanently there.
     
  3. ledzgio

    ledzgio New Member

    Yes I am under a VM and probably that is the problem, thanks.

    Now I don't find the /et/amavisd.conf file so I don't know where I have to set the full hostname parameter. I am on debian 7 with amavisd 2.7.1.

    Could you please suggest me how to fix that?

    thanks
     
  4. srijan

    srijan New Member HowtoForge Supporter

    Hi ledzgio,

    I have suggestion here, please check whether any process of dhclient is running in the system.

    If it is present kill the process. Here two cases happens, either you will be on debian server or fedora or centos.

    Case 1:

    Fedora/CentOS


    vi /etc/sysconfig/network-scripts/ifcfg-<interface>
    change BOOTPROTO=dhcp to BOOTPROTO=static or BOOTPROTO=none


    Case2:
    Debian

    vi /eth/network/interfaces

    change this to

    where 192.168.0.1 & 255.255.255.0 are your entries.

    Br//
    srijan
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    debian uses a splitted config, you find the different parts of the config file in /etc/amavis/conf.d/
     
  6. ledzgio

    ledzgio New Member

    Ok thanks, it should be the file 50-user in /etc/amavis/conf.d.

    The problem is that I don't know what to put inside and in which format..I can't find anything useful out there.

    Thanks again
     
    Last edited by a moderator: Feb 1, 2015
  7. ledzgio

    ledzgio New Member

    Ok I solved by adding a boot script to init.d which modifies the /etc/hosts file as I need on each boot.

    thanks anyway
     
    Last edited by a moderator: Feb 1, 2015

Share This Page