Mandriva: Why is /etc/resolv.conf overwritten at boot?
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
[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.
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...").
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?
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.
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.
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.
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.
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.
Location: France, Languedoc-Roussillon (pre frontiere espagnol)
Distribution: Puppy Linux!
Posts: 16
Rep:
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!
Location: France, Languedoc-Roussillon (pre frontiere espagnol)
Distribution: Puppy Linux!
Posts: 16
Rep:
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!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.