From owner-freebsd-hackers@FreeBSD.ORG Fri Jun 15 13:42:19 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 855D81065674 for ; Fri, 15 Jun 2012 13:42:19 +0000 (UTC) (envelope-from fluffy@fluffy.khv.ru) Received: from forward11.mail.yandex.net (forward11.mail.yandex.net [95.108.130.93]) by mx1.freebsd.org (Postfix) with ESMTP id 3415E8FC19 for ; Fri, 15 Jun 2012 13:42:19 +0000 (UTC) Received: from smtp11.mail.yandex.net (smtp11.mail.yandex.net [95.108.130.67]) by forward11.mail.yandex.net (Yandex) with ESMTP id B5D4CE81F9E; Fri, 15 Jun 2012 17:42:17 +0400 (MSK) Received: from smtp11.mail.yandex.net (localhost [127.0.0.1]) by smtp11.mail.yandex.net (Yandex) with ESMTP id 93F2E7E0521; Fri, 15 Jun 2012 17:42:17 +0400 (MSK) Received: from host85.static2.l2tp.ttkdv.ru (host85.static2.l2tp.ttkdv.ru [46.38.1.85]) by smtp11.mail.yandex.net (nwsmtp/Yandex) with ESMTP id gFnWHjLt-gGnGraTt; Fri, 15 Jun 2012 17:42:16 +0400 X-Yandex-Rcpt-Suid: varuna@eudaemonicsystems.net X-Yandex-Rcpt-Suid: freebsd-hackers@freebsd.org Message-ID: <4FDB3BAA.6090906@fluffy.khv.ru> Date: Sat, 16 Jun 2012 00:42:02 +1100 From: Dima Panov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Varuna References: <4FDB25E0.2070705@eudaemonicsystems.net> In-Reply-To: <4FDB25E0.2070705@eudaemonicsystems.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Cc: freebsd-hackers@freebsd.org Subject: Re: /etc/resolv.conf getting over written with dhcp X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: fluffy@FreeBSD.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2012 13:42:19 -0000 15.06.2012 23:09, Varuna написал: > Hello Folks, > > Noticed a strange issue with the creation / update of > /etc/resolv.conf. The details of the system that I noticed the issue > on is: > Version : FreeBSD 8.0 > Patch level: not patched > Uname: FreeBSD shastry.eudaemonicsystems.net 8.0-RELEASE FreeBSD > 8.0-RELEASE #0: Thu Sep 29 22:37:51 IST 2011 > root@shastry.bhuta.in:/usr/obj/usr/src/sys/SHASTRY i386 > > > I generally have a static IP 192.168.98.6 (via rc.conf) for my > Beastie. The contents of my /etc/resolv.conf is as follows: > domain eudaemonicsystems.net > nameserver 208.67.222.222 > nameserver 208.67.220.220 > nameserver 4.2.2.2 > No matter how many times I reboot the system, the resolv.conf does not > get overwritten when configured with a static IP. > > I modified the /etc/rc.conf to have the flag: > ifconfig_re0="DHCP" > The next reboot of the system caused the /etc/resolv.conf to be > overwritten with the following contents: > nameserver 192.168.98.4 > > I was baffled with this behaviour and checked /etc/rc.d/resolv script > and there was no reason as to why "[ ! -e /etc/resolv.conf]" should > fail at any given instance. Out of curiosity executed "/bin/kenv > dhcp.domain-name" which returned with the info: kenv: unable to get > dhcp.domain-name. Would it be fair to assume that /etc/rc.d/resolv > not to cause the issue? > > What is causing this behaviour? Have I missed something? > > Had a look at network-dhcp.html, and found /etc/dhclient.conf to be > empty on my system. > > Digging further, was looking at the scripts under /etc/rc.d, found > /etc/rc.d/named to be another script creating the /etc/resolv.conf and > this was in the routine named_precmd(). I have not enabled > 'named_enable' flag in /etc/rc.conf, while it is commented; by > default; in /etc/defaults/rc.conf file. > From my /etc/dhclient.conf: interface "lagg0" { send dhcp-lease-time 3600; prepend domain-name-servers 127.0.0.1, 4.4.4.4, 8.8.8.8; request subnet-mask, broadcast-address, time-offset, routers, domain-name, domain-name-servers; require subnet-mask, domain-name-servers; } And result is /etc/resolv.conf: # Generated by resolvconf nameserver 127.0.0.1 nameserver 4.4.4.4 nameserver 8.8.8.8 nameserver 192.168.1.1 -- Dima Panov (fluffy@FreeBSD.org) (KDE, Office)@FreeBSD team Facebook: http://www.facebook.com/fluffy.khv IRC: fluffy@EFNet, fluffykhv@FreeNode twitter: fluffy_khv | skype: dima.panov