LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-14-2007, 09:35 AM   #1
fc6_user
Member
 
Registered: Jan 2007
Location: Montpellier, France
Distribution: Fedora Core 6, Mandriva, Knoppix, Debian
Posts: 143

Rep: Reputation: 15
Mandriva: Why is /etc/resolv.conf overwritten at boot?


I made the mistake of modifying my Internet connection configuration. The idea was to change the settings to hook up two computers. I did this via a graphic utility in Mandriva. Anyway, all I want now is my Internet connection back and the answer to a few questions, but, before I get to that, I'll have to explain what the problem is.

I have figured out how to manually get my Internet connection working again (ADSL, wired connection). All I need to do is open up the resolv.conf.save file and save it as resolv.conf and, abracadabra, I get my connection working again. What I can't figure out is why the resolv.conf file is overwritten every time I reboot my computer. There must be a file that I can edit so that the settings (DNS or DHPC or whatever, I'm new at this, and know very little about what all this means...) are correct when booting. I do want dynamic IP addresses.

So my question(s): What causes the resolv.conf file to be overwritten at boot? What file is responsible for this? Can I edit this file (not the resolv.conf, but rather the one that causes it to be overwritten)? How can I get my Internet connections back to normal? How can I revert to the default settings?

My resolve.conf file reads as follows:
nameserver 192.168.0.2
nameserver 0.0.0.0
search localhost

My resolv.conf.save reads as follows:
nameserver 192.168.1.1
nameserver 0.0.0.0

Many thanks.
 
Old 05-14-2007, 10:28 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Don't use Mandriva so don't know where the file is but it should be called dhclient.conf.

In there you can override what DHCP puts into your /etc/resolv.conf.

example:
supersede domain-name "mydomain.com myotherdomain.net dmz.mydomain.com";

Would make it use the above hosts as the name servers instead of whichever hosts DHCP suggests.
 
Old 05-14-2007, 03:15 PM   #3
fc6_user
Member
 
Registered: Jan 2007
Location: Montpellier, France
Distribution: Fedora Core 6, Mandriva, Knoppix, Debian
Posts: 143

Original Poster
Rep: Reputation: 15
This is what I have in /sbin:

[root@localhost sbin]# ls -a d*
debugfs* depmod-25* dmsetup* dump@ dump.ext3*
delpart* dhclient* dmsetup-static* dumpe2fs*
depmod@ dhclient-script* dosfsck* dump.ext2@

I've looked everywhere else and haven't found any other dhclient files. I don't know how to run a search from "/". If you give me the command, I'll do it and paste the results here (i.e., search for all files which have dhclient in their names).

I looked in dhclient*, which is very long and incomprehensible. dhclient-script* is somewhat comprehensible to me... I recognized some of the if statements, etc. (I've just started dabbling with some programming)... It's much shorter too, but I imagine you already know this.

Hmm... Don't really know where to take it from here.
 
Old 05-14-2007, 03:17 PM   #4
fc6_user
Member
 
Registered: Jan 2007
Location: Montpellier, France
Distribution: Fedora Core 6, Mandriva, Knoppix, Debian
Posts: 143

Original Poster
Rep: Reputation: 15
P.S. - By the way, I don't know how to run a search within a file either. I remember seeing it somewhere and doing it, but that was a while ago (to search for "supersede domainname...").
 
Old 05-14-2007, 05:27 PM   #5
fc6_user
Member
 
Registered: Jan 2007
Location: Montpellier, France
Distribution: Fedora Core 6, Mandriva, Knoppix, Debian
Posts: 143

Original Poster
Rep: Reputation: 15
Solution found!!

I did it via a graphical network configuration tool rather than from the command line though.

Here's what I did, although, please don't take the following literally, MY INTERFACE IS IN FRENCH, SO THE FOLLOWING IS A ROUGH TRANSLATION:

-From the main menu -> System -> Configuration -> Computer Configuration (OR Configuring My Computer)
-Then, enter root password (written on this window at this point: "command: /usr/sbin/drakconf.real").
-Choose Networks & Internet from the left hand side of the window.
-Choose the first option: "Configure a New Internet Connection (LAN, ISDN, ADSL...). A Wizard will be launched.
-Choose Ethernet (Next...)
-Choose the network adapter (I only had one!) (Next...)
-Choose "Attribute an IP address automatically"
-On this next screen ("Ethernet" written, then below it "IP parameters", then "Obtain DNS servers from DHCP"...), in order to change what is in gray below, you have to uncheck (un-'tick') the box, change it, then check it (tick it) again (strange!): THIS IS WHAT MY PROBLEM WAS, THE IP ADDRESS IN "DNS SERVER 1" WAS THE ONE THAT CORRESPONDED TO THE resolv.conf FILE (192.168.0.2). I SUBSTITUTED IT FOR THE ONE IN THE resolv.conf.save FILE (192.168.1.1). Next...
-Next, next, next... etc.

And it all started working again as usual, even after rebooting.

Many thanks, jlightner, for your post. Perhaps you know how I could have done the same thing via configuration files?

Cheers.
 
Old 05-15-2007, 08:00 AM   #6
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Glad you found a solution.

Most configuration files are in /etc or /var.

One way to look for files of a given name is to use the find command:

So to look in /etc for dhclient.conf you could have typed:
find /etc -name dhclient.conf

Or to look in the entire system for any file with dhclient in its name:
find / -name *dhclient*

(Note you might have to put quotes around *dhclient* - sometimes you do sometimes you don't.)

Your GUI probably updated the file. It also possible it wasn't dhclient.conf - there are other DHCP clients available for Linux but this is the one I've used on both Debian and Fedora Core.
 
Old 05-15-2007, 08:36 AM   #7
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
Mandriva has its own config files, and on startup it uses its own config files to overwrite many of the standard GNU/Linux config files. The Mandriva tools configure the mandriva config files, and that is why everything then works.

No, I don't know enough of the details of the Mandriva config files to tell you what to do; I just use the graphical tools myself.
 
Old 05-16-2007, 09:08 AM   #8
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Given that you don't know which config files Mandriva uses how do you know its GUIs aren't just updating the standard config files? That is what the GUIs in FC6 do - you can use them to configure things but underneath it all they're just updating the files that one could have configured by hand.
 
Old 05-16-2007, 10:26 AM   #9
Avatar
Member
 
Registered: May 2001
Location: Canada
Distribution: old ones
Posts: 555

Rep: Reputation: 33
To search within a file on the command line, if you are using vi or vim for your text editor, you just type (while not in edit mode) / followed by the word you are looking for. So if you are searching for the word "dns" you type "/dns". Hope this can help in the future.
 
Old 05-16-2007, 10:48 AM   #10
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
I think he misstated what he wanted to do - he needed to find the file.

By the way you can use grep to look for text within a file without opening it as you do with vi (vim).
 
Old 05-16-2007, 01:48 PM   #11
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by jlightner
Given that you don't know which config files Mandriva uses how do you know its GUIs aren't just updating the standard config files? That is what the GUIs in FC6 do - you can use them to configure things but underneath it all they're just updating the files that one could have configured by hand.
Because if you change one of the standard config files without using the Mandriva tools, the change often doesn't survive a reboot. Hence, the Mandriva tools must be changing some other config files as well and, given that lots of standard config files are indeed rewritten by mandriva on startup, it follows that Mandriva has its own files buried in the system.
 
Old 05-17-2007, 06:57 PM   #12
starlyte
LQ Newbie
 
Registered: Mar 2007
Location: France, Languedoc-Roussillon (pre frontiere espagnol)
Distribution: Puppy Linux!
Posts: 16

Rep: Reputation: 0
Can I use a modem from another FAI to access Alice?(OK everyone makes mistakes but they refuse to change my f*** up modem - but don't want me to pay for a while!). Anyhow, if I can use Freebox, or whatever, how should I go about it? It doesn't seem to work even when I re-enregister all...
I use Mandriva2007.1 personalised a big bit.
Help!
 
Old 05-17-2007, 06:59 PM   #13
starlyte
LQ Newbie
 
Registered: Mar 2007
Location: France, Languedoc-Roussillon (pre frontiere espagnol)
Distribution: Puppy Linux!
Posts: 16

Rep: Reputation: 0
Modems different from the FAI

Quote:
Originally Posted by starlyte
Can I use a modem from another FAI to access Alice?(OK everyone makes mistakes but they refuse to change my f*** up modem - but don't want me to pay for a while!). Anyhow, if I can use Freebox, or whatever, how should I go about it? It doesn't seem to work even when I re-enregister all...
I use Mandriva2007.1 personalised a big bit.
Help!
 
  


Reply



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
/etc/resolv.conf being overwritten... detpenguin Slackware 4 04-12-2005 01:42 PM
9.1... ntp.conf overwritten on boot german Slackware 2 02-16-2005 11:01 AM
Resolv.conf Overwritten jlcarmic Debian 2 05-27-2004 08:14 AM
resolv.conf overwritten on boot cjpsparks Linux - Networking 1 11-06-2003 02:06 AM
resolv.conf overwritten LocHolmez Linux - Networking 2 09-22-2003 09:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:14 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration