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 1OmkPv-00082v-TE for garchives@archives.gentoo.org; Sat, 21 Aug 2010 09:31:12 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4AC48E0478; Sat, 21 Aug 2010 09:30:58 +0000 (UTC) Received: from mail.gmx.net (mailout-de.gmx.net [213.165.64.22]) by pigeon.gentoo.org (Postfix) with SMTP id D4E8DE0894 for ; Sat, 21 Aug 2010 09:30:57 +0000 (UTC) Received: (qmail invoked by alias); 21 Aug 2010 09:30:56 -0000 Received: from 77-22-218-57-dynip.superkabel.de (EHLO marcec.huntemann.uni-oldenburg.de) [77.22.218.57] by mail.gmx.net (mp060) with SMTP; 21 Aug 2010 11:30:56 +0200 X-Authenticated: #38048819 X-Provags-ID: V01U2FsdGVkX1+mYtZi78amOkLanEw45FzQvoWFwsdLRzdy4Z0qkf FCw3b4bB81NksV Date: Sat, 21 Aug 2010 11:30:47 +0200 From: Marc Joliet To: Gentoo-User ML Subject: Re: [gentoo-user] DHCPCD and nameserver Message-ID: <20100821113047.4c98e6ba@marcec.huntemann.uni-oldenburg.de> In-Reply-To: References: <4C6F6F2B.80906@gmail.com> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; x86_64-pc-linux-gnu) 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 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/AGZf_9bVw.JqXT9AIjytOnJ"; protocol="application/pgp-signature" X-Y-GMX-Trusted: 0 X-Archives-Salt: 01c9eb8b-c36e-48ac-b4c1-313fa935df87 X-Archives-Hash: 3b80038b2c6826f4b07016d25de27961 --Sig_/AGZf_9bVw.JqXT9AIjytOnJ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Am Sat, 21 Aug 2010 09:15:26 +0059 schrieb Jorge Almeida : [...] > I don't know about dhcpcd, but I'm using dhclient, and it works like this: > $cat /etc/resolv.conf > config_eth0=3D("dhcp") > modules_eth0=3D("dhclient") > dhcp_eth0=3D"nodns" >=20 > I'm not sure the last line is necessary. > Then: >=20 > $ cat /etc/dhcp/dhclient.conf > append option domain-name-servers 127.0.0.1 >=20 > Substitute 127.0.0.1 by 8.8.8.8 With dhcpcd you can do something similar. When I was setting up dnsmasq on = my system I found out you can create hooks for dhcpcd; for instance, in /etc/dhcpcd.enter-hook I have (well, now "had"): # Prepend localhost to the list of DNS servers new_domain_name_servers=3D"127.0.0.1 ${new_domain_name_servers}" The resulting resolv.conf: marcec marcec # cat /etc/resolv.conf # Generated by dhcpcd from eth0 # /etc/resolv.conf.head can replace this line search huntemann.uni-oldenburg.de nameserver 127.0.0.1 nameserver 192.168.0.250 # /etc/resolv.conf.tail can replace this line However, the comments in resolv.conf indicate you you can create one or bot= h of /etc/resolv.conf.{head,tail}, which will be merged into /etc/resolv.conf automatically! The resulting resolv.conf: marcec marcec # cat /etc/resolv.conf # Generated by dhcpcd from eth0 # force localhost as first nameserver nameserver 127.0.0.1 search huntemann.uni-oldenburg.de nameserver 192.168.0.250 # /etc/resolv.conf.tail can replace this line So both methods are slighly different. I think I'll stick with the latter n= ow, as I think it's more correct. However, I'm not sure whether this works with other DHCP clients or just for dhcpcd. > HTH > > Jorge HTH -- Marc Joliet -- Lt. Frank Drebin: "It's true what they say: cops and women don't mix. Like eating a spoonful of Dr=C4=81no; sure, it'll clean you out, but it'll leave= you hollow inside." --Sig_/AGZf_9bVw.JqXT9AIjytOnJ Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) iEYEARECAAYFAkxvnM0ACgkQBsMBz3L8+WNlqgCeNvQFKiPyYrvCOKH85ROmET1c vkUAoJNeHSsOJaZ76DYrunkL2f+thS+S =KsSX -----END PGP SIGNATURE----- --Sig_/AGZf_9bVw.JqXT9AIjytOnJ--