/etc/resolv.conf getting automatically written over....HELP PLEASE!
Hi all;
I just recently upgraded my system from mandriva 2007 to cooker 2008. The problem is that my /etc/resolve.conf which was working fine seems to have been updated with a bunch of new entries. I go in and manually edit it but every time I boot or run dhclient it rewrites the file and re enters all the entries I have edited out. How do I stop the system from regenerating this file automatically. I tried changing the permission to read only but that didn't help, it still got over written. I would appreciate any help you could give thanks. Chris |
I'm sure there is a more elegant way, but as a lazy hack you could make it immutable
chattr +i /etc/resolv.conf |
Hi thanks
I tried that and it did work but it gave me a new error message during start up saying? FAILED to write to resolv.conf, I can't find the exact error as I'm not sure what log shows the started [ok] or [failed] start up entries. I looked in the the messages log and found these entries. These seem to be the file over writing my edits. Oct 6 12:31:38 HELL NET[4339]: /etc/sysconfig/network-scripts/ifup-post : updated /etc/resolv.conf Oct 6 12:21:58 HELL NET[6137]: /sbin/dhclient-script : updated /etc/resolv.conf Are there any other ideas? Thanks. |
Well, yeah. Once you make it immutable noboody (including root) can write to it. You would have to remove the immutable bit with chattr -i /etc/resolv.conf
So this is an expected error and I thought it was what you wanted. If it's causing other problems then remove the immutable bit. Your resolv.conf file just holds the names of your nameservers. What are you putting in there and what is it being overwritten with? |
Thanks Jon;
This is what I want in there? # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN search gv.shawcable.net nameserver 64.59.160.15 nameserver 64.59.160.13 But this is what is showing up. I have tried emptying the file completely, everything, permission. but can't fix it. The problem is with it like this having 6 item it's SUPER slow to connect to the internet like a minute before a page comes up. nameserver 64.59.160.13 nameserver 64.59.160.15 search gv.shawcable.net search gv.shawcable.net nameserver 64.59.160.15 nameserver 64.59.160.13 Thanks again for any help you can give. Chris |
you must use static ip not dhcp
do it from your network setting in you r distro regards |
In my distro Mandriva 2008 I do have it as a manual not DHCP. Which is weird, Too me this file should not getting updated.
|
Quote:
If you have access to the DHCP server, you can put your Shaw nameservers in there, but if you don't then you'll have to go static as others have pointed out. |
All times are GMT -5. The time now is 09:54 AM. |