From owner-freebsd-net@FreeBSD.ORG Tue Aug 29 12:03:51 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 CD76016A4E0 for ; Tue, 29 Aug 2006 12:03:51 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id 69F1B43E40 for ; Tue, 29 Aug 2006 12:02:43 +0000 (GMT) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (qdovsj@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id k7TC2MaG012961; Tue, 29 Aug 2006 14:02:27 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.4/8.13.1/Submit) id k7TC2MnX012960; Tue, 29 Aug 2006 14:02:22 +0200 (CEST) (envelope-from olli) Date: Tue, 29 Aug 2006 14:02:22 +0200 (CEST) Message-Id: <200608291202.k7TC2MnX012960@lurza.secnetix.de> From: Oliver Fromme To: freebsd-net@FreeBSD.ORG, julian@elischer.org In-Reply-To: <44EF6E18.6090905@elischer.org> X-Newsgroups: list.freebsd-net User-Agent: tin/1.8.0-20051224 ("Ronay") (UNIX) (FreeBSD/4.11-STABLE (i386)) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Tue, 29 Aug 2006 14:02:28 +0200 (CEST) Cc: Subject: Re: possible patch for implementing split DNS X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-net@FreeBSD.ORG, julian@elischer.org 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 12:03:51 -0000 Julian Elischer wrote: > I need some processes to look elsewhere for DNS information from where > 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 > environment variable. > This would allow me to reset this to an application specific config file > that > specifies a different server. 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). 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: $ 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=default $ cat /etc/resolv.conf nameserver 11.22.33.44 $ varsym RES=special $ cat /etc/resolv.conf nameserver 55.66.77.88 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. 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. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. "Life is short (You need Python)" -- Bruce Eckel, ANSI C++ Comitee member, author of "Thinking in C++" and "Thinking in Java"