LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Resolv.conf Overwritten (https://www.linuxquestions.org/questions/debian-26/resolv-conf-overwritten-186104/)

jlcarmic 05-26-2004 11:56 AM

Resolv.conf Overwritten
 
So I used the business card version of the beta 4 installer for debian. The install is happy, and I choose dhclient during the tasksel part of things. I have two systems with this same issue. One is set for static IP the other dynamic. Each gives me resolving host name issues. I add the appropriate lines into resolv.conf but it is overwritten on each restart.

I have seen this issue on other lists and tried tweaking dhclient-script and dhclient.conf as suggested. No luck. I even tried the solution of stripping write access to the file from everyone. On restart the permissions have been changed so that root has write access again and the file has been overwritten again.

Anyone less confused than me on this one?

JC

--edit--
If it helps, I just did a reinstall and this time did not select the Broadband package in tasksel. Everything works wonderfully now. Guess it is something in there. So now everything works, but knowing what was the issue is still nice.

Linux.tar.gz 05-26-2004 09:23 PM

You can add a script at startup which make:
rm /etc/resolv.conf
cp /etc/resolv.conf.thegoodone /etc/resolv.conf

jlcarmic 05-27-2004 08:14 AM

Fixed Resolv.conf overwrite issue
 
Thank you for the reply. I was looking for more a reason why rather than a workaround, though workaround ideas are always useful. Below is an email I got from one of the resolvconf guys on the debian bugs list explaining what the problem may be:

John wrote:

>> I add the appropriate lines into resolv.conf but it is overwritten on
>> each restart.

Joshua replied:

>> This smells like the resolvconf package screwing things up. Resolvconf
>> folks, feel free to reassign this back if you think this isn't your
>> problem...


First let me point out that if you have resolvconf installed then
you should not make manual changes to the resolver configuration
file because the file is automatically generated. You can indeed
control what goes into the automatically generated file, but only
by modifying the sources that are used to generate it. See
resolvconf(8) for instructions.

Note, however, that resolvconf never writes to /etc/resolv.conf
directly. It sets up a symlink from /etc/resolv.conf to
/etc/resolvconf/run/resolv.conf and then writes to the latter file.
So if /etc/resolv.conf (itself, not its target) is being overwritten
then resolvconf is not the culprit. There are lots of packages out
there that futz with resolv.conf. One of my chief occupations during
the past year has been hunting down all these packages and getting
them to disable their trickery when resolvconf is installed. One
package that slipped through the cracks until recently was
dhcp-client, as discussed in #248399.

To summarize #248399: until recently dhcp-client lacked resolvconf
support. (Support was not added because it was expected that
dhcp-client would be replaced by what is currently dhcp3-client.
dhcp3-client has had resolvconf support for a long time. However,
dhcp3-client never became dhcp-client and the installer is still
installing dhcp-client.) Prior to the addition of resolvconf
support, dhclient-script wrote directly to /etc/resolv.conf.

echo search $new_domain_name >/etc/resolv.conf
echo nameserver $nameserver >>/etc/resolv.conf

Resolvconf's postinst sets up

/etc/resolv.conf -> /etc/resolvconf/run/resolv.conf

so with resolvconf installed, dhclient-script's information ended
up in /etc/resolvconf/run/resolv.conf and was promptly overwritten
by resolvconf.

The solution to #248399 was to add resolvconf support to
dhcp-client. This was done in dhcp-client version 2.0pl5-17 which
was uploaded on 16 May 2004. That version hasn't made it into
testing yet.

With resolvconf support added, dhclient-script sends its information
to resolvconf if it sees that resolvconf is installed and this
information gets merged into the automatically generated file.

John: I would appreciate it if you would check to make
sure that this bug has been fixed. Install the broadband task
again and upgrade dhcp-client to the latest from unstable. Your
resolv.conf should be updated automagically.

I am closing #251066 with this message, but please reopen it if
it turns out that there is still a bug somewhere.
--
Thomas Hood

So I installed unstable which gave me the dhcp3 version of things and everything is happy in debian land again.


All times are GMT -5. The time now is 07:28 AM.