New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Comments
Do you have DHCP enabled?
option one - chattr +i /etc/resolv.conf (not sure if it will work, maybe try it)
Option two - modify/overwrite resolv.conf with your own version from rc.local for instance. But the all daemons that start before rc.local runs would use the hosts's resolv.conf
Set PEERDNS=no in ifcfg-venet0 file.
Just don't reboot :P
I think OpenVZ overwrites the resolv.conf file when it boots the VPS.
Make a script that overwrites the overwritten file on startup
At times this solution works.
your /etc/resolv.conf is being written by solusvm-openvz script on startup generally when the host provider sets its block of IP to a specific dns ip. Maybe easiest way is for you to just create a startup script or a crontab entry and insert the echo commands below
echo "nameserver 127.0.0.1" >> /etc/resolv.conf
nano /etc/rc.local
echo 'nameserver 4.8.8.8' > /etc/resolv.conf
or
nano /etc/rc.local
cp /backup/resolv.conf /etc/resolv.conf
Or:
..and use @reboot crontab command (it will execute your script only after reboot)
export EDITOR=nano
crontab -e
@reboot cd /root; ./resolv.sh >/dev/null 2>&1