From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QWsEV-00065s-Bo for garchives@archives.gentoo.org; Wed, 15 Jun 2011 15:42:19 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 90F531C0B5; Wed, 15 Jun 2011 15:40:47 +0000 (UTC) Received: from mail-pz0-f53.google.com (mail-pz0-f53.google.com [209.85.210.53]) by pigeon.gentoo.org (Postfix) with ESMTP id 51F191C0B5 for ; Wed, 15 Jun 2011 15:40:47 +0000 (UTC) Received: by pzk6 with SMTP id 6so403332pzk.40 for ; Wed, 15 Jun 2011 08:40:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type:content-transfer-encoding; bh=Zw4eQnzoOnu4a6gJRywpHXKizyfhCeFW8iO8ELwsIJw=; b=NSWWyu0T347B2fBGK4oo2B3gy+GdApIKkhVP5J8t9+JuBEOzjMcg5N/TX9xH5GVnLh IsWNh+7UEAuDb9bjARRv/Po8YDVfs4ObXpov9+pgbxGv1Vh+bIO2J2RRSx3DCqKQ7xgl zWwb/29kpEownlNbr4yOeyuHYDfjhRC9Jt7s0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=TpLSNziIPtJgHf5bLV8p+4ugeHg2S+feddn+bVImYFLDi/0zJPAnPEiob2FavZ3zp1 3/7Vl1JJrHnrqOGeJpGkuhRr+5Wjz41elIBCNrIboP+Lek9+OAGjPpTQJoo8WB55UO/q WxOkZANJP2Qsjf+A8eLt1E0CuH1pLSrKPnKqQ= Received: by 10.68.5.68 with SMTP id q4mr416150pbq.117.1308152446583; Wed, 15 Jun 2011 08:40:46 -0700 (PDT) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Received: by 10.68.49.200 with HTTP; Wed, 15 Jun 2011 08:40:25 -0700 (PDT) In-Reply-To: <20110615142725.GA20949@ksp.sk> References: <4DF8BCAF.2090804@binarywings.net> <20110615142725.GA20949@ksp.sk> From: =?UTF-8?Q?Juan_Diego_Tasc=C3=B3n?= Date: Wed, 15 Jun 2011 10:40:25 -0500 Message-ID: Subject: Re: [gentoo-user] Override DHCP-provided DNS To: gentoo-user@lists.gentoo.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 76c58f1294764bb0bd859ee6663b89eb On Wed, Jun 15, 2011 at 9:27 AM, YoYo Siska wrote: > On Wed, Jun 15, 2011 at 04:07:43PM +0200, Florian Philipp wrote: >> Hello list! >> >> for some wireless access points, I want to get an IP via DHCP but not >> use the provided DNS-server (I use an openvpn setup with its own DNS >> server, domain name, etc.). >> >> In /usr/share/doc/openrc-0.8.2-r1/net.example it reads: >> # Setting name/domain server causes /etc/resolv.conf to be overwritten >> # Note that if DHCP is used, and you want this to take precedence then >> # please put -R in your dhcpcd options >> >> But dhcpcd does not seem to have a -R option. It does have a --static >> option, though. While this is good enough for simply setting the DNS >> server, it does not seem to allow specifying domain names or >> search-domains (at least it is not shown in the man-page). >> >> Please tell me what the proper way is and whether the mention of "-R" is >> a documentation bug. >> >> Thanks in advance, >> Florian Philipp > > from the man page, this seems to do =C2=A0what you want > (never tried, i use dhclient and its /etc/dhcp/dhclient.conf): > > =C2=A0 =C2=A0 -C, --nohook script > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Don't run this hook script. =C2= =A0Matches full name, or prefixed with 2 numbers optionally ending with .sh= . > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 So to stop dhcpcd from touching= your DNS or MTU settings you would do:- > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 dhcpcd -C = resolv.conf -C mtu eth0 > > > =C2=A0yoyo > > I use the google dns servers so I created a /etc/resolv.conf file and set the i attribute on it: chattr +i /etc/resolv.conf that way it can't be removed or overwritten and you won't have that problem no matter what dhcp client you are using