From owner-freebsd-net@FreeBSD.ORG Tue Aug 29 14:02:34 2006 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E9ED416A4DD for ; Tue, 29 Aug 2006 14:02:33 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from sccmmhc91.asp.att.net (sccmmhc91.asp.att.net [204.127.203.211]) by mx1.FreeBSD.org (Postfix) with ESMTP id D801043D66 for ; Tue, 29 Aug 2006 14:02:26 +0000 (GMT) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net ([12.207.12.9]) by sccmmhc91.asp.att.net (sccmmhc91) with ESMTP id <20060829140225m9100h58rpe>; Tue, 29 Aug 2006 14:02:25 +0000 Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.13.6/8.13.6) with ESMTP id k7TE2JTi013163; Tue, 29 Aug 2006 09:02:20 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.13.6/8.13.6/Submit) id k7TE2JWp013162; Tue, 29 Aug 2006 09:02:19 -0500 (CDT) (envelope-from brooks) Date: Tue, 29 Aug 2006 09:02:19 -0500 From: Brooks Davis To: freebsd-net@freebsd.org, julian@elischer.org Message-ID: <20060829140218.GA13054@lor.one-eyed-alien.net> References: <44EF6E18.6090905@elischer.org> <200608291202.k7TC2MnX012960@lurza.secnetix.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="rwEMma7ioTxnRzrJ" Content-Disposition: inline In-Reply-To: <200608291202.k7TC2MnX012960@lurza.secnetix.de> User-Agent: Mutt/1.5.11 Cc: Subject: Re: possible patch for implementing split DNS X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Aug 2006 14:02:34 -0000 --rwEMma7ioTxnRzrJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 29, 2006 at 02:02:22PM +0200, Oliver Fromme wrote: > Julian Elischer wrote: > > I need some processes to look elsewhere for DNS information from where= =20 > > the rest > > of the system looks.. This patch seems to me a simple solution. > > We over-ride where the resolver looks for resolv.conf using an=20 > > environment variable. > > This would allow me to reset this to an application specific config fi= le=20 > > that > > specifies a different server. >=20 > I think that could be useful indeed. In fact it could have > been very helpful to me recently when I had to debug a very > strange resolver problem (it turned out that the DSL modem > dropped SOA and ANY requests). >=20 > In theory, there would be a different (and maybe better) > solution to the problem. On the "FreeBSD Ideas" web page > there is an entry to port variant symlinks from DragonFly > (but as far as I know, nobody is actually working on it). > Using variant symlinks, the problem could easily be solved: >=20 > $ ls -l /etc/resolv* > -r--r--r-- 1 root wheel ... /etc/resolv.conf -> resolv-${RES}.conf > -r--r--r-- 1 root wheel ... /etc/resolv-default.conf > -r--r--r-- 1 root wheel ... /etc/resolv-special.conf > $ varsym RES > RES=3Ddefault > $ cat /etc/resolv.conf > nameserver 11.22.33.44 > $ varsym RES=3Dspecial > $ cat /etc/resolv.conf > nameserver 55.66.77.88 >=20 > It also has the advantage that the admin still has some > control over it, because the symlink can only point to > existing files under /etc in this case. By the way, the > varsym variables can be set globally, per-user and per- > process. >=20 > However, I'm aware that variant symlinks are probably not > going to be available in FreeBSD anytime soon. Therefore > I think your patch to libc/net/res_init.c would be useful. Actually there's a patch floating around. I don't remember what the most recent status is, but it does work and I've got it in the branch I run on my laptop. There's some diagreement about the order of evaluation of the various tables with the patch implementing a pid overrides user which overrides global and rwatson arguing for the opposite (which is what AFS does). I think I'd like to see the AFS version plus a "default" table since I find Robert's arguments compelling, but have applications where a default is needed. Alternativly ${varname-default_value} syntax could be implemented alongside AFS semantics. -- Brooks P.S. The motivating application in my case is making /tmp a varsym which points to storage with the ordinary semantics for ordinary processes, but is overriden to point to a managed directory for processes within a batch job under Sun Grid Engine. --rwEMma7ioTxnRzrJ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQFE9EjqXY6L6fI4GtQRAqR3AJ9r5YQwPsRoxBHRET7S3y3u+qKlAwCbBB9k Liz5w8cMVbvhsh1ZJTdnNj4= =s652 -----END PGP SIGNATURE----- --rwEMma7ioTxnRzrJ--