LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 05-11-2009, 12:36 AM   #1
herpules
LQ Newbie
 
Registered: Feb 2006
Posts: 6

Rep: Reputation: 0
resolv.conf keeps getting rewritten


There is a file /etc/resolv.conf, and in that file are two nameservers which get accessed by internet applications. I know what two nameservers will make my applications successful in obtaining data from the web. So I set the file appropriately and everything works.

Then I reboot the computer and something rewrites it with two different nameservers. And my web pages time out.

I think I have gone through several different mysterious "somethings" since I've had this problem through several Ubuntu updates. I thought the culprit was called network-manager before, but I don't seem to have a network-manager now. There maybe twelve different applications all waiting their turn to helpfully rewrite resolv.conf for me.

So... I just want them to leave me alone.


Ubuntu 9.04
Qwest DSL
integrated MCP61 Ethernet card
(Is there other system information that might be relevant here?)
 
Old 05-11-2009, 12:50 AM   #2
jdkaye
Senior Member
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 4,687

Rep: Reputation: Disabled
Quote:
Originally Posted by herpules View Post
There is a file /etc/resolv.conf, and in that file are two nameservers which get accessed by internet applications. I know what two nameservers will make my applications successful in obtaining data from the web. So I set the file appropriately and everything works.

Then I reboot the computer and something rewrites it with two different nameservers. And my web pages time out.

I think I have gone through several different mysterious "somethings" since I've had this problem through several Ubuntu updates. I thought the culprit was called network-manager before, but I don't seem to have a network-manager now. There maybe twelve different applications all waiting their turn to helpfully rewrite resolv.conf for me.

So... I just want them to leave me alone.


Ubuntu 9.04
Qwest DSL
integrated MCP61 Ethernet card
(Is there other system information that might be relevant here?)
I think the "culprit" is your ISP acting through your router/modem. I had a similar problem (I wanted to use open dns servers and not the one supplied by my ISP). I solved it by installing the dhcp3-client and dhcp3-common packages. This will create an /etc/dhcp3/dhclient.conf file. As root or using sudo add the following line to this file:
Code:
prepend domain-name-servers {dns-server1_ip},{dns-server2_ip};
Just replace the {dns-server...} place holders with the ip number of the dns servers you want to use and Bob's your uncle.
cheers,
jdk
 
Old 05-11-2009, 02:12 AM   #3
herpules
LQ Newbie
 
Registered: Feb 2006
Posts: 6

Original Poster
Rep: Reputation: 0
That's not fixing it. Maybe it's trying, but something else is overcoming it? (Or did I miss a step? I can see dhclient running.)

/etc/resolv.conf is being rewritten by NetworkManager according to the first line of the file, which executes scripts in /etc/NetworkManager/dispatcher.d/, which currently contains 01ifupdown. 01ifupdown calls ifupdown scripts in /etc/network/, and so on and so on.
 
Old 05-11-2009, 03:44 AM   #4
jdkaye
Senior Member
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 4,687

Rep: Reputation: Disabled
Quote:
Originally Posted by herpules View Post
That's not fixing it. Maybe it's trying, but something else is overcoming it? (Or did I miss a step? I can see dhclient running.)

/etc/resolv.conf is being rewritten by NetworkManager according to the first line of the file, which executes scripts in /etc/NetworkManager/dispatcher.d/, which currently contains 01ifupdown. 01ifupdown calls ifupdown scripts in /etc/network/, and so on and so on.
You have to actually run
Code:
sudo dhclient
to activate things (and possibly also stop and start your network connection). cheers,
jdk
 
Old 05-11-2009, 07:34 AM   #5
herpules
LQ Newbie
 
Registered: Feb 2006
Posts: 6

Original Poster
Rep: Reputation: 0
For some reason I thought you wanted me to actually include the curly braces.

Now it keeps rewriting all four nameservers, which I think is as functional as just having the good two. Thanks!
 
Old 05-11-2009, 08:36 AM   #6
jdkaye
Senior Member
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 4,687

Rep: Reputation: Disabled
Quote:
Originally Posted by herpules View Post
For some reason I thought you wanted me to actually include the curly braces.

Now it keeps rewriting all four nameservers, which I think is as functional as just having the good two. Thanks!
Well done! We have defeated the evil isp's ! You can edit the dhclient.conf file and remove the unwanted servers if you like.
cheers,
jdk
 
  


Reply

Tags
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
resolv.conf keeps getting rewritten!! jcbparry Mandriva 7 05-28-2007 08:34 AM
My resolv.conf file is being rewritten JimRivera Linux - Networking 1 12-08-2005 07:17 PM
Sound muted at boot, ntpd.conf rewritten spaceballs Slackware 1 02-22-2005 01:14 AM
/etc/resolv.conf being rewritten at startup jawaking00 Linux - Networking 2 07-01-2004 08:17 AM
resolv.conf is rewritten on startup smurf Linux - Networking 1 03-23-2004 03:19 AM


All times are GMT -5. The time now is 05:23 AM.

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