[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Content of /etc/resolv.conf changes after reboot



On Wed, Aug 07, 2002 at 03:23:05PM +0200, Frank Brodbeck wrote:
| It's me again...
| 
| I'm having here a strange problem. Long time ago I told my Debian
| the time I installed it that my nameserver is 194.129.2.25
| But I had to change my nameserver. Every time I edit my resolv
| by hand it gets lost after a time or at boot up. I guess - or better
| I hope - that it's changing it back to the exactly old nameserver
| because the fact that I told at installation of Debian that this 
| should be my nameserver. Does anybody knows a hint for me?

Are you using DHCP?  If so, then every time you bring up the interface
your resolv.conf will be overwritten.  That is because in normal DHCP
setups, the DHCP server knows what nameserver you are supposed to be
using, so your system listens to it and acts accordingly.

I don't have a "normal" DHCP setup (one NIC used DHCP but I wanted to
use my own nameserver anyways), so what I did was apply this patch to
/etc/dhclient-script :

--- dhclient-script.orig	2002-08-07 09:54:06.000000000 -0400
+++ dhclient-script	2002-08-07 09:53:44.000000000 -0400
@@ -33,9 +33,9 @@
 }
 
 make_resolv_conf() {
-  echo "search $new_domain_name" >/etc/resolv.conf
+  echo "# search $new_domain_name" >>/etc/resolv.conf
   for nameserver in $new_domain_name_servers; do
-    echo "nameserver $nameserver" >>/etc/resolv.conf
+    echo "# nameserver $nameserver" >>/etc/resolv.conf
   done
 }
 

Of course, to do that requires you to use the 'dhcp-client' package
(not 'dhcpcd' or 'pump').

HTH,
-D

-- 
There is not a righteous man on earth
    who does what is right and never sins.
        Ecclesiastes 7:20
 
http://dman.ddts.net/~dman/

Attachment: pgpM_icONcMh3.pgp
Description: PGP signature


Reply to: