All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
how to set startup script to change dns in /etc/resolv.conf centos7
I again seek help from the server gods of LET.
my recent project is based on a local hosting provider and they are using LXC based lightweight Linux Containers.
at every reboot, the server automatically sets DNS in /etc/resolv.conf
here is an example of how it looks like-
--- BEGIN PVE ---
search abc.domain.tld
nameserver 0.0.0.0
nameserver 0.0.0.0--- END PVE ---
problem is, the vps dosent connect to internet with this config but i can ssh login and change the settings to followings to make the vps connect to internet.
search google.com
nameserver 8.8.8.8
nameserver 8.8.4.4
so is there any way to automatically change the data in resolv.conf after every restart? if so, can anyone point me to a guide that i can follow.
Comments
Did you google? https://askubuntu.com/questions/824781/auto-edit-resolv-conf-on-system-startup
Seriously google things first
Also, I would ask to the provider why he does not allow me to set my own nameservers.
EDIT: Actually, it allows you to do that, but in a slightly different way.
Or try making
resolv.conf
immutable (chattr +i
) after making your changes.This is the right way!
tried everything that came across google, nothing worked
either i get locked out of my vps or it changes back to the default one.
tried, dosent work
chattr +i /etc/resolv.conf ?
[root@9545 fahim]# chattr +i /etc/resolv.conf
chattr: Operation not permitted while setting flags on /etc/resolv.conf
Ahh! Forgot it’s lxc. Not sure if there’s an workaround sadly
this is my default config, but with this no ping response to google.com or any other site, but directadmin works on browser
--- BEGIN PVE ---
search alpha.net.bd
nameserver 69.13.47.26
nameserver 69.13.47.26
--- END PVE ---
is there any change that i can redirect this ip to 8.8.8.8 using host file?
On Proxmox? It's less than a minute's worth of work.
i contacted my provider, still waiting for response. i brought the container as vps, they dont have any affordable kvm solution.
after countless hours of stress, this worked
touch /etc/.pve-ignore.resolv.conf
I presume you saw this: https://forum.proxmox.com/threads/how-to-disable-auto-updates-of-etc-hostsname-etc-resolv-conf-maybe-others.76186/