I use Juniper Networks network connect to connect to the office network. Once i am inside the office network, i check the server ips and add entries for them in /etc/hosts file like,10.199.xx.yy  offiWhen i come out of the VPN network into public domain, network connect resets all changes it made and brings my /etc/hosts file to the state it was in before entering the network. I think, this behaviour is Juniper Network connect's expected behaviour as it adds an entry on the top of the hosts file as,# BEGIN hosts added by Network Connect61.xx.yy.zz  vpn.ip.com# END hosts added by Network ConnectBut in trying to reset its own entries, network connect reset the user made entries as well..I tried to make /etc/hosts as immutable using chattr +i /etc/hosts but that caused my vpn login to fail as network connect comes out, if it fails to write into /etc/hosts
Make user made entries in /etc/hosts permanent
vpn;openvpn;hosts