LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 10-06-2007, 11:25 PM   #1
cbradlea
LQ Newbie
 
Registered: Mar 2005
Posts: 28

Rep: Reputation: 15
/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
 
Old 10-06-2007, 11:28 PM   #2
jonwatson
Member
 
Registered: Jun 2004
Location: Nova Scotia, Canada!
Distribution: Ubuntu
Posts: 170

Rep: Reputation: 30
I'm sure there is a more elegant way, but as a lazy hack you could make it immutable

chattr +i /etc/resolv.conf
 
Old 10-07-2007, 12:08 AM   #3
cbradlea
LQ Newbie
 
Registered: Mar 2005
Posts: 28

Original Poster
Rep: Reputation: 15
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.
 
Old 10-08-2007, 07:36 AM   #4
jonwatson
Member
 
Registered: Jun 2004
Location: Nova Scotia, Canada!
Distribution: Ubuntu
Posts: 170

Rep: Reputation: 30
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?
 
Old 10-08-2007, 11:26 AM   #5
cbradlea
LQ Newbie
 
Registered: Mar 2005
Posts: 28

Original Poster
Rep: Reputation: 15
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
 
Old 10-08-2007, 12:04 PM   #6
linux obsessed
LQ Newbie
 
Registered: Sep 2007
Location: /home
Distribution: Linux
Posts: 25
Blog Entries: 1

Rep: Reputation: 0
you must use static ip not dhcp
do it from your network setting in you r distro
regards
 
Old 10-08-2007, 08:46 PM   #7
cbradlea
LQ Newbie
 
Registered: Mar 2005
Posts: 28

Original Poster
Rep: Reputation: 15
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.
 
Old 10-09-2007, 08:02 PM   #8
jonwatson
Member
 
Registered: Jun 2004
Location: Nova Scotia, Canada!
Distribution: Ubuntu
Posts: 170

Rep: Reputation: 30
Quote:
Originally Posted by cbradlea View Post
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.
When your computer DHCPs it not only gets an IP address, but it also gets the nameservers.

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.
 
  


Reply

Tags
immutable, resolvconf


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DNS Hosts.conf or resolv.conf problem mac_casey Suse/Novell 0 03-26-2006 09:21 AM
resolv.conf albundy Linux - Software 5 12-14-2004 03:12 PM
resolv.conf?? wrat Linux - Newbie 3 06-14-2004 04:37 PM
resolv.conf is not updated automatically metalyric Linux - Networking 9 06-04-2004 05:51 AM
resolv.conf ricemark20 Linux - Networking 12 11-11-2003 04:08 PM


All times are GMT -5. The time now is 07:21 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration