Howto lock Resolv.conf from changing nameserver
F17
how does one lockin nameserver in resolv.conf. It keeps changing nameserver to 192.168.1.1 which is my Router gateway IP. |
Add DNS{0,1,2}= statements to the /etc/sysconfig/network-scripts/ifcfg-%{devicename} configuration file?
|
This is my new ifcfg-p128p1 (which is eth0)
It still changes resolv.conf to nameserver 192.168.1.1, Is it possible that NetworkManger is doing the changes instead of ifcfg-p128p1 ? UUID="e676da02-6018-4567-8c0f-ab849ac673cb" NM_CONTROLLED="yes" HWADDR="78:E3:B5:95:98:2C" BOOTPROTO="dhcp" DEVICE="p128p1" ONBOOT="yes" PEERDNS=no DNS1=8.8.8.8 DNS2=8.8.0.0 PEERDNS=no is not suppose to change resolv.conf if it is already set to 8.8.8.8. |
Quote:
|
Ahh, the beauty of bloatware. Alas, over the last two or three years I've watched as Linux developers push new "management" software that does things behind the scenes like Windows. Pulseaudio, NetworkManager, SELinux, all three of which I either disable or remove after every upgrade, much to the chagrin of these well meaning programmers. Here I go again, after I swore to myself not to bite the hand that feeds me - in this case all the Linux developers that make it possible for me to run a free, good operating system. My recommendation in your case is remove NetworkManager.
Code:
yum remove NetworkManager |
Wouldn't making the file immutable do the trick?
Code:
chmod +i /etc/resolv.conf |
Quote:
|
Yes, remembering could be an issue. The "why can't I edit that file" thing might drive one temporarily insane.
|
Quote:
Quote:
Code:
nano() { i=($(lsattr "$1")); i=${i[0]}; case ${i//-/} in *i*) chattr -iu "$1";; esac; nano "$1"; chattr =$i "$1"; } |
All times are GMT -5. The time now is 09:31 AM. |