View Full Version : Local manual DNS settings won't stick; ISP keeps overwriting, please help!
bluespruce
14th November 2008, 10:10 PM
The title pretty much says it all. I already unchecked the 'aquire dns settings automatically' box, yet every time I put in the DNS servers I would LIKE to use, save the settings and reconnect, I find they've reverted to the ISP standard! It's really become quite infuriating.
This started about a week-10 days ago and has become more and more resistant to my efforts to change them.
Many thanks in advance to anyone able to keep me from pulling my hair out :p
bluespruce
17th November 2008, 03:25 PM
It was suggested to me on another forum that I should try to chmod the file to write protect it. How do I do that? What file should I chmod?
aleph
17th November 2008, 03:55 PM
The title pretty much says it all. I already unchecked the 'aquire dns settings automatically' box, yet every time I put in the DNS servers I would LIKE to use, save the settings and reconnect, I find they've reverted to the ISP standard! It's really become quite infuriating.
This started about a week-10 days ago and has become more and more resistant to my efforts to change them.
Many thanks in advance to anyone able to keep me from pulling my hair out :p
I suggest you create a file (as root) in the /etc directory with name "dhclient-INTERFACE.conf" where INTERFACE is the connection's network interface (e.g. eth0). Put the following line in the file:
supersede domain-name-servers DNS1, DNS2, DNS3;
where DNS1-3 are your preferred DNS servers. You don't have to use all three of them. Usually putting two there is fine.
After that, restart the network service, and see if it works.
ibbo
18th November 2008, 12:18 PM
you can also edit you /etc/rc.local file and add
echo # DNS config > /etc/resolve.conf
echo nameserver PRIMARY_DNS >> /etc/resolve.conf
echo nameserver SECONDRY_DNS >> /etc/resolve.conf
echo nameserver TERIATRY_DNS >> /etc/resolve.con
This basically overwrites your resolve.conf (which stores your DNS settings) and adds your preferred DNS servers instead.
Just run /etc/rc.local after you edit it. It runs by itself after your machine has booted up so you edit and leave it unless your DNS changes.
aleph
Nice one. You learn something new every day.
Ibbo
vallimar
18th November 2008, 03:35 PM
It was suggested to me on another forum that I should try to chmod the file to write protect it. How do I do that? What file should I chmod?
Just for reference, they were talking about the immutable flag.
This is enabled by doing: chmod +i <file>
bluespruce
18th November 2008, 08:16 PM
Just for reference, they were talking about the immutable flag.
This is enabled by doing: chmod +i <file>
actually, to be specific, he said to chmod +x the file /etc/resolv.conf "so its not rewriteable" (however, this is coming from a freebsd user, so neither of us are sure how accurate the info is)
What is the immutable flag?
Sorry I haven't been able to give any feedback, I haven't had the time to sit down at my own computer in a bit, but I really appreciate the suggestions!
I'll be sure to let you guys know as soon as I get things back up and running :)
ibbo
19th November 2008, 11:22 AM
The immutable flag denotes whether a file can be modified or not. +i = immutable = no modifiable. -i is the opposite.
chmod +i file on a file that is modified at boot time (or will attempt to be modified) will no doubt issue complaint after complaint. Thus it is not the correct way to do it and the alternative options listed above should be taken up instead.
I.E
edit rc.local
or
the option given by aleph
It always better to do it right that to hack it out. hack it out and you will have to hack it again at some stage.
Ibbo
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.