Hi,
I searched the forums but didn't see this exact question answered. I also googled it. When I edit /etc/resolv.conf with custom nameservers, the changes eventually revert. How can I make them "sticky"?
thanks in advance,
orange
How to force resolv.conf changes to "stick"?
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
How to force resolv.conf changes to "stick"?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: How to force resolv.conf changes to "stick"?
Are you editing it as 'root'?....
Code: Select all
gksudo gedit /etc/resolv.conf
Re: How to force resolv.conf changes to "stick"?
Yes, I am. The changes are saved until I reboot. I do not know if takes a single reboot or multiple before the change, or maybe it is when I connect to a different wifi system. The nameserver changes from (my edits) 8.8.8.8 to 192.168.1.1, which is the gateway/router.GeneC wrote:Are you editing it as 'root'?....
Code: Select all
gksudo gedit /etc/resolv.conf
Re: How to force resolv.conf changes to "stick"?
If you are using network manager then you set nameservers in the connection properties, manual edits to resolv.conf will be overwritten.
[Edit] your original post and add [SOLVED] once your question is resolved.
“The people are my God” stressing the factor determining man’s destiny lies within man not in anything outside man, and thereby defining man as the dominator and remoulder of the world.
“The people are my God” stressing the factor determining man’s destiny lies within man not in anything outside man, and thereby defining man as the dominator and remoulder of the world.
Re: How to force resolv.conf changes to "stick"?
You can make it write-protected with:
if in the future you want to undo this to change it again:
Code: Select all
sudo chattr +i /etc/resolv.conf
Code: Select all
sudo chattr -i /etc/resolv.conf
Re: How to force resolv.conf changes to "stick"?
I've done it that way, too. Doesn't seem to stick.remoulder wrote:If you are using network manager then you set nameservers in the connection properties, manual edits to resolv.conf will be overwritten.
Re: How to force resolv.conf changes to "stick"?
I'm just posting to maybe help you. I think I figured it out. if you
comment out the line that says
i.e.
that should be it! Check for the correct dns server.
If there are problems, make sure that in network manager, there are no stray dns servers.
hope that helps.
Code: Select all
edit /etc/NetworkManager/NetworkManager.conf
Code: Select all
dns=dnsmasq
Code: Select all
#dns=dnsmasq
Code: Select all
sudo restart network-manager
Code: Select all
cat /etc/resolv.conf
If there are problems, make sure that in network manager, there are no stray dns servers.
hope that helps.